From pekka.jaaskelainen at tut.fi Mon Aug 13 00:36:01 2012 From: pekka.jaaskelainen at tut.fi (=?ISO-8859-1?Q?Pekka_J=E4=E4skel=E4inen?=) Date: Mon, 13 Aug 2012 08:36:01 +0300 Subject: [llvm-commits] patch to llvm-link to link in archives In-Reply-To: References: <5024D584.90305@nokia.com> Message-ID: <50289241.9020600@tut.fi> On 08/11/2012 05:44 PM, Rafael Esp?ndola wrote: > Is there any particular reason we need our own archive format? The existing > solutions for doing LTO (linker plugin) and the one being developed (lld) > work with the native system formats, so IMHO we should drop the llvm > specific one. In our case of TCE, we use bitcode archives for whole program optimizations and simply for the end user convenience (-lsomelib instead of a bunch of .o files in the compiler cmdline). TCE/TTA is an end-user customizable standalone target which benefits from this kind of not-fully-target-specific format at the compiler user level. http://blog.llvm.org/2010/06/tce-project-co-design-of-application.html Another project of ours is the Portable OpenCL (pocl) where we use bitcode archives for the kernel API library to ensure aggressive inlining of the calls can be done before kernel code generation. Is there other portable solution that permits these cases nicely and *on all platforms*? Or, looking from the another aspect: is it really so much code to maintain that one benefits much from removal given there are users for that feature? -- Pekka From samsonov at google.com Mon Aug 13 02:41:43 2012 From: samsonov at google.com (Alexey Samsonov) Date: Mon, 13 Aug 2012 07:41:43 -0000 Subject: [llvm-commits] [compiler-rt] r161747 - /compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Message-ID: <20120813074143.E5E992A6C076@llvm.org> Author: samsonov Date: Mon Aug 13 02:41:43 2012 New Revision: 161747 URL: http://llvm.org/viewvc/llvm-project?rev=161747&view=rev Log: [Sanitizer] Return cmake support for setting compile definitions for sanitizer_common library Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=161747&r1=161746&r2=161747&view=diff ============================================================================== --- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original) +++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Mon Aug 13 02:41:43 2012 @@ -23,6 +23,9 @@ -fvisibility=hidden ) +set(SANITIZER_COMMON_DEFINITIONS) + +set(SANITIZER_RUNTIME_LIBRARIES) if(APPLE) # Build universal binary on APPLE. add_library(RTSanitizerCommon.osx OBJECT ${SANITIZER_SOURCES}) @@ -30,18 +33,24 @@ filter_available_targets(SANITIZER_TARGETS x86_64 i386) set_target_properties(RTSanitizerCommon.osx PROPERTIES OSX_ARCHITECTURES "${SANITIZER_TARGETS}") + list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.osx) else() # Otherwise, build separate libraries for each target. if(CAN_TARGET_X86_64) add_library(RTSanitizerCommon.x86_64 OBJECT ${SANITIZER_SOURCES}) set_target_compile_flags(RTSanitizerCommon.x86_64 ${SANITIZER_CFLAGS} ${TARGET_X86_64_CFLAGS}) + list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.x86_64) endif() if(CAN_TARGET_I386) add_library(RTSanitizerCommon.i386 OBJECT ${SANITIZER_SOURCES}) set_target_compile_flags(RTSanitizerCommon.i386 ${SANITIZER_CFLAGS} ${TARGET_I386_CFLAGS}) + list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.i386) endif() endif() +set_property(TARGET ${SANITIZER_RUNTIME_LIBRARIES} APPEND PROPERTY + COMPILE_DEFINITIONS ${SANITIZER_COMMON_DEFINITIONS}) + # FIXME: Add support for running sanitizer_common unit tests. From baldrick at free.fr Mon Aug 13 03:23:25 2012 From: baldrick at free.fr (Duncan Sands) Date: Mon, 13 Aug 2012 10:23:25 +0200 Subject: [llvm-commits] [patch] Add dominance computation for edges In-Reply-To: References: Message-ID: <5028B97D.7030303@free.fr> Hi Rafael, On 06/08/12 02:20, Rafael Esp?ndola wrote: > In LLVM the only value that is defined in an edge is the return value > of an invoke. There are cases however where a fact is true only in > areas dominated by and edge. For example, in > > define i32 @f(i32 %x) { > bb0: > %cmp = icmp eq i32 %x, 0 > br i1 %cmp, label %bb2, label %bb1 > bb1: > br label %bb2 > bb2: > %cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ] > %foo = add i32 %cond, %x > ret i32 %foo > } > > We can replace x with 0 in cond, but not in foo. > > The attached patch refactors the code we have to handle invoke so that > it is available to clients that want to know if a use is dominated by > an edge. maybe this is useful for GVN's replaceAllDominatedUsesWith and/or isOnlyReachableViaThisEdge? Ciao, Duncan. From baldrick at free.fr Mon Aug 13 03:25:32 2012 From: baldrick at free.fr (Duncan Sands) Date: Mon, 13 Aug 2012 10:25:32 +0200 Subject: [llvm-commits] [llvm] r160170 - /llvm/trunk/include/llvm/Support/CommandLine.h In-Reply-To: References: <20120713125523.55FAC2A6C06D@llvm.org> <50001D6E.7070105@free.fr> Message-ID: <5028B9FC.8040206@free.fr> LGTM. Ciao, Duncan. On 23/07/12 19:52, Alexander Kornienko wrote: > I've added a test that shows a condition when my patch helps. > It fails under valgrind with rev 160170 reverted: > > $ svn merge -r 160170:160169 https://llvm.org/svn/llvm-project/llvm/trunk > $ cd your-build-dir > $ make check-all > $ valgrind unittests/Support/SupportTests > ... > [ RUN ] CommandLineTest.ParseEnvironmentToLocalVar > ==12673== Conditional jump or move depends on uninitialised value(s) > ==12673== at 0x659A17: > GetOptionInfo(llvm::SmallVectorImpl&, > llvm::SmallVectorImpl&, > llvm::StringMap&) (in > /usr/local/google/users/alexfh/cmake-clang-build/unittests/Support/SupportTests) > ==12673== by 0x657E27: llvm::cl::ParseCommandLineOptions(int, char const* > const*, char const*, bool) (in > /usr/local/google/users/alexfh/cmake-clang-build/unittests/Support/SupportTests) > ==12673== by 0x657B70: llvm::cl::ParseEnvironmentOptions(char const*, > char const*, char const*, bool) (in > /usr/local/google/users/alexfh/cmake-clang-build/unittests/Support/SupportTests) > ==12673== by 0x495B2F: (anonymous > namespace)::CommandLineTest_ParseEnvironmentToLocalVar_Test::TestBody() (in > /usr/local/google/users/alexfh/cmake-clang-build/unittests/Support/SupportTests) > ... > > With rev 160170 in place this valgrind message isn't triggered: > > $ svn revert include/llvm/Support/CommandLine.h > $ cd your-build-dir > $ make check-all > $ valgrind unittests/Support/SupportTests > ... > [ RUN ] CommandLineTest.ParseEnvironmentToLocalVar > [ OK ] CommandLineTest.ParseEnvironmentToLocalVar (10 ms) > ... > > There are also a few tests in tools/clang/tests/Tooling that fail on their own > (i.e. without valgrind) without rev 160170, but these failures highly depend on > external conditions and surrounding code layout (however, valgrind consistently > finds issues even if the code doesn't break). > > Is it enough to prove validity of my previous patch? > > > On Mon, Jul 16, 2012 at 3:28 PM, Chandler Carruth > wrote: > > On Mon, Jul 16, 2012 at 6:24 AM, Alexander Kornienko > wrote: > > On Mon, Jul 16, 2012 at 3:10 PM, Chandler Carruth > wrote: > > On Mon, Jul 16, 2012 at 6:02 AM, Alexander Kornienko > > wrote: > > > On Fri, Jul 13, 2012 at 3:06 PM, Duncan Sands > wrote: > > Hi Alexander, > > Initializers for some fields were missing in Option::Option > > did it matter? If so, please add a testcase. If not, why > this change? > > This did matter. It caused random crashes in case cl::opt was a > member of non-POD class. > > > Hold on, a *member*? 'cl::opt' objects are supposed to be globals, > not members. > > We need it as a member to make a class which handles a common subset of > command-line options for several clang tools. In a close future we'll > need a control on which options should be enabled and which not. So we > can't do it with global variables. Why can't we use it as a member? > > > Errr... Ok, this is something we should discuss in more depth. > > Essentially, it's not that you necessarily can't, it's that the library was > never designed with that use case in mind. It's completely outside the > contract of the library, and so random things are likely to continue > breaking. If this the correct design, we need to at least extend the library > with unittests to check its behavior in that context. These unittests would > then be what you would run under Valgrind in order to detect the failure. > > > > > -- > Alexander Kornienko | Software Engineer |alexfh at google.com > |+49 151 221 77 957 > Google Germany GmbH | Dienerstr. 12 | 80331 M?nchen > From Tim.Northover at arm.com Mon Aug 13 04:06:32 2012 From: Tim.Northover at arm.com (Tim Northover) Date: Mon, 13 Aug 2012 09:06:32 -0000 Subject: [llvm-commits] [llvm] r161748 - /llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Message-ID: <20120813090632.4F0C12A6C075@llvm.org> Author: tnorthover Date: Mon Aug 13 04:06:31 2012 New Revision: 161748 URL: http://llvm.org/viewvc/llvm-project?rev=161748&view=rev Log: Use correct loads for vector types during extending-load operations. Previously, we used VLD1.32 in all cases, however there are both 16 and 64-bit accesses being selected, so we need to use an appropriate width load in those cases. Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrNEON.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrNEON.td?rev=161748&r1=161747&r2=161748&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrNEON.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrNEON.td Mon Aug 13 04:06:31 2012 @@ -5597,26 +5597,27 @@ // Vector lengthening move with load, matching extending loads. // extload, zextload and sextload for a standard lengthening load. Example: -// Lengthen_Single<"8", "i16", "i8"> = -// Pat<(v8i16 (extloadvi8 addrmode6oneL32:$addr)) -// (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr, -// (f64 (IMPLICIT_DEF)), (i32 0)))>; +// Lengthen_Single<"8", "i16", "8"> = +// Pat<(v8i16 (extloadvi8 addrmode6:$addr)) +// (VMOVLuv8i16 (VLD1d8 addrmode6:$addr, +// (f64 (IMPLICIT_DEF)), (i32 0)))>; multiclass Lengthen_Single { + let AddedComplexity = 10 in { def _Any : Pat<(!cast("v" # DestLanes # DestTy) - (!cast("extloadv" # SrcTy) addrmode6oneL32:$addr)), + (!cast("extloadvi" # SrcTy) addrmode6:$addr)), (!cast("VMOVLuv" # DestLanes # DestTy) - (VLD1LNd32 addrmode6oneL32:$addr, - (f64 (IMPLICIT_DEF)), (i32 0)))>; + (!cast("VLD1d" # SrcTy) addrmode6:$addr))>; + def _Z : Pat<(!cast("v" # DestLanes # DestTy) - (!cast("zextloadv" # SrcTy) addrmode6oneL32:$addr)), + (!cast("zextloadvi" # SrcTy) addrmode6:$addr)), (!cast("VMOVLuv" # DestLanes # DestTy) - (VLD1LNd32 addrmode6oneL32:$addr, - (f64 (IMPLICIT_DEF)), (i32 0)))>; + (!cast("VLD1d" # SrcTy) addrmode6:$addr))>; + def _S : Pat<(!cast("v" # DestLanes # DestTy) - (!cast("sextloadv" # SrcTy) addrmode6oneL32:$addr)), + (!cast("sextloadvi" # SrcTy) addrmode6:$addr)), (!cast("VMOVLsv" # DestLanes # DestTy) - (VLD1LNd32 addrmode6oneL32:$addr, - (f64 (IMPLICIT_DEF)), (i32 0)))>; + (!cast("VLD1d" # SrcTy) addrmode6:$addr))>; + } } // extload, zextload and sextload for a lengthening load which only uses @@ -5648,8 +5649,8 @@ // extload, zextload and sextload for a lengthening load followed by another // lengthening load, to quadruple the initial length. // -// Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32", qsub_0> = -// Pat<(v4i32 (extloadvi8 addrmode5:$addr)) +// Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32"> = +// Pat<(v4i32 (extloadvi8 addrmode6oneL32:$addr)) // (EXTRACT_SUBREG (VMOVLuv4i32 // (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr, // (f64 (IMPLICIT_DEF)), @@ -5663,19 +5664,19 @@ (!cast("extloadv" # SrcTy) addrmode6oneL32:$addr)), (!cast("VMOVLuv" # Insn2Lanes # Insn2Ty) (EXTRACT_SUBREG (!cast("VMOVLuv" # Insn1Lanes # Insn1Ty) - (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), + (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0))>; def _Z : Pat<(!cast("v" # DestLanes # DestTy) (!cast("zextloadv" # SrcTy) addrmode6oneL32:$addr)), (!cast("VMOVLuv" # Insn2Lanes # Insn2Ty) (EXTRACT_SUBREG (!cast("VMOVLuv" # Insn1Lanes # Insn1Ty) - (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), + (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0))>; def _S : Pat<(!cast("v" # DestLanes # DestTy) (!cast("sextloadv" # SrcTy) addrmode6oneL32:$addr)), (!cast("VMOVLsv" # Insn2Lanes # Insn2Ty) (EXTRACT_SUBREG (!cast("VMOVLsv" # Insn1Lanes # Insn1Ty) - (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), + (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0))>; } @@ -5684,9 +5685,9 @@ // requiring half the available lanes (a 64-bit outcome instead of a 128-bit). // // Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32"> = -// Pat<(v4i32 (extloadvi8 addrmode5:$addr)) +// Pat<(v2i32 (extloadvi8 addrmode6:$addr)) // (EXTRACT_SUBREG (VMOVLuv4i32 -// (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr, +// (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd16 addrmode6:$addr, // (f64 (IMPLICIT_DEF)), (i32 0))), // dsub_0)), // dsub_0)>; @@ -5694,34 +5695,33 @@ string Insn1Lanes, string Insn1Ty, string Insn2Lanes, string Insn2Ty> { def _Any : Pat<(!cast("v" # DestLanes # DestTy) - (!cast("extloadv" # SrcTy) addrmode6oneL32:$addr)), + (!cast("extloadv" # SrcTy) addrmode6:$addr)), (EXTRACT_SUBREG (!cast("VMOVLuv" # Insn2Lanes # Insn2Ty) (EXTRACT_SUBREG (!cast("VMOVLuv" # Insn1Lanes # Insn1Ty) - (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), + (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0)>; def _Z : Pat<(!cast("v" # DestLanes # DestTy) - (!cast("zextloadv" # SrcTy) addrmode6oneL32:$addr)), + (!cast("zextloadv" # SrcTy) addrmode6:$addr)), (EXTRACT_SUBREG (!cast("VMOVLuv" # Insn2Lanes # Insn2Ty) (EXTRACT_SUBREG (!cast("VMOVLuv" # Insn1Lanes # Insn1Ty) - (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), + (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0)>; def _S : Pat<(!cast("v" # DestLanes # DestTy) - (!cast("sextloadv" # SrcTy) addrmode6oneL32:$addr)), + (!cast("sextloadv" # SrcTy) addrmode6:$addr)), (EXTRACT_SUBREG (!cast("VMOVLsv" # Insn2Lanes # Insn2Ty) (EXTRACT_SUBREG (!cast("VMOVLsv" # Insn1Lanes # Insn1Ty) - (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), + (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0)>; } -defm : Lengthen_Single<"8", "i16", "i8">; // v8i8 -> v8i16 -defm : Lengthen_Single<"4", "i32", "i16">; // v4i16 -> v4i32 -defm : Lengthen_Single<"2", "i64", "i32">; // v2i32 -> v2i64 +defm : Lengthen_Single<"8", "i16", "8">; // v8i8 -> v8i16 +defm : Lengthen_Single<"4", "i32", "16">; // v4i16 -> v4i32 +defm : Lengthen_Single<"2", "i64", "32">; // v2i32 -> v2i64 defm : Lengthen_HalfSingle<"4", "i16", "i8", "8", "i16">; // v4i8 -> v4i16 -defm : Lengthen_HalfSingle<"2", "i16", "i8", "8", "i16">; // v2i8 -> v2i16 defm : Lengthen_HalfSingle<"2", "i32", "i16", "4", "i32">; // v2i16 -> v2i32 // Double lengthening - v4i8 -> v4i16 -> v4i32 @@ -5732,17 +5732,17 @@ defm : Lengthen_Double<"2", "i64", "i16", "4", "i32", "2", "i64">; // Triple lengthening - v2i8 -> v2i16 -> v2i32 -> v2i64 -def : Pat<(v2i64 (extloadvi8 addrmode6oneL32:$addr)), +def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)), (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16 - (VLD1LNd32 addrmode6oneL32:$addr, + (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>; -def : Pat<(v2i64 (zextloadvi8 addrmode6oneL32:$addr)), +def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)), (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16 - (VLD1LNd32 addrmode6oneL32:$addr, + (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>; -def : Pat<(v2i64 (sextloadvi8 addrmode6oneL32:$addr)), +def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)), (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16 - (VLD1LNd32 addrmode6oneL32:$addr, + (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>; //===----------------------------------------------------------------------===// From samsonov at google.com Mon Aug 13 04:57:19 2012 From: samsonov at google.com (Alexey Samsonov) Date: Mon, 13 Aug 2012 09:57:19 -0000 Subject: [llvm-commits] [compiler-rt] r161749 - /compiler-rt/trunk/lib/asan/asan_report.cc Message-ID: <20120813095719.901172A6C075@llvm.org> Author: samsonov Date: Mon Aug 13 04:57:19 2012 New Revision: 161749 URL: http://llvm.org/viewvc/llvm-project?rev=161749&view=rev Log: [ASan] If ASan finds second error report, wait for some time and die (instead of running in a busy loop) to make sure ASan won't hang if it finds error while reporting an error in the same thread Modified: compiler-rt/trunk/lib/asan/asan_report.cc Modified: compiler-rt/trunk/lib/asan/asan_report.cc URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=161749&r1=161748&r2=161749&view=diff ============================================================================== --- compiler-rt/trunk/lib/asan/asan_report.cc (original) +++ compiler-rt/trunk/lib/asan/asan_report.cc Mon Aug 13 04:57:19 2012 @@ -213,11 +213,11 @@ // they are defined as no-return. AsanReport("AddressSanitizer: while reporting a bug found another one." "Ignoring.\n"); + // We can't use infinite busy loop here, as ASan may try to report an + // error while another error report is being printed (e.g. if the code + // that prints error report for buffer overflow results in SEGV). SleepForSeconds(Max(5, flags()->sleep_before_dying + 1)); - // Try to prevent substituting infinite busy loop with _exit or smth - // like that. - volatile int x = 1; - while (x) { } + Die(); } AsanPrintf("====================================================" "=============\n"); From Tim.Northover at arm.com Mon Aug 13 05:38:45 2012 From: Tim.Northover at arm.com (Tim Northover) Date: Mon, 13 Aug 2012 10:38:45 -0000 Subject: [llvm-commits] [llvm] r161750 - /llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll Message-ID: <20120813103845.58D372A6C075@llvm.org> Author: tnorthover Date: Mon Aug 13 05:38:45 2012 New Revision: 161750 URL: http://llvm.org/viewvc/llvm-project?rev=161750&view=rev Log: Add test for previous commit correcting NEON load patterns. Added: llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll (with props) Added: llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll?rev=161750&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll Mon Aug 13 05:38:45 2012 @@ -0,0 +1,102 @@ +; RUN: llc -mtriple=armv7-none-linux-gnueabi < %s | FileCheck %s + + at var_v2i8 = global <2 x i8> zeroinitializer + at var_v4i8 = global <4 x i8> zeroinitializer + + at var_v2i16 = global <2 x i16> zeroinitializer + at var_v4i16 = global <4 x i16> zeroinitializer + + at var_v2i32 = global <2 x i32> zeroinitializer + at var_v4i32 = global <4 x i32> zeroinitializer + + at var_v2i64 = global <2 x i64> zeroinitializer + +define void @test_v2i8tov2i32() { +; CHECK: test_v2i8tov2i32: + + %i8val = load <2 x i8>* @var_v2i8 + + %i32val = sext <2 x i8> %i8val to <2 x i32> + store <2 x i32> %i32val, <2 x i32>* @var_v2i32 +; CHECK: vld1.16 {d[[LOAD:[0-9]+]][0]}, [{{r[0-9]+}}, :16] +; CHECK: vmovl.s8 {{q[0-9]+}}, d[[LOAD]] +; CHECK: vmovl.s16 {{q[0-9]+}}, {{d[0-9]+}} + + ret void +} + +define void @test_v2i8tov2i64() { +; CHECK: test_v2i8tov2i64: + + %i8val = load <2 x i8>* @var_v2i8 + + %i64val = sext <2 x i8> %i8val to <2 x i64> + store <2 x i64> %i64val, <2 x i64>* @var_v2i64 +; CHECK: vld1.16 {d{{[0-9]+}}[0]}, [{{r[0-9]+}}, :16] +; CHECK: vmovl.s8 {{q[0-9]+}}, d[[LOAD]] +; CHECK: vmovl.s16 {{q[0-9]+}}, {{d[0-9]+}} +; CHECK: vmovl.s32 {{q[0-9]+}}, {{d[0-9]+}} + +; %i64val = sext <2 x i8> %i8val to <2 x i64> +; store <2 x i64> %i64val, <2 x i64>* @var_v2i64 + + ret void +} + +define void @test_v4i8tov4i16() { +; CHECK: test_v4i8tov4i16: + + %i8val = load <4 x i8>* @var_v4i8 + + %i16val = sext <4 x i8> %i8val to <4 x i16> + store <4 x i16> %i16val, <4 x i16>* @var_v4i16 +; CHECK: vld1.32 {d[[LOAD:[0-9]+]][0]}, [{{r[0-9]+}}, :32] +; CHECK: vmovl.s8 {{q[0-9]+}}, d[[LOAD]] +; CHECK-NOT: vmovl.s16 + + ret void +; CHECK: bx lr +} + +define void @test_v4i8tov4i32() { +; CHECK: test_v4i8tov4i32: + + %i8val = load <4 x i8>* @var_v4i8 + + %i16val = sext <4 x i8> %i8val to <4 x i32> + store <4 x i32> %i16val, <4 x i32>* @var_v4i32 +; CHECK: vld1.32 {d[[LOAD:[0-9]+]][0]}, [{{r[0-9]+}}, :32] +; CHECK: vmovl.s8 {{q[0-9]+}}, d[[LOAD]] +; CHECK: vmovl.s16 {{q[0-9]+}}, {{d[0-9]+}} + + ret void +} + +define void @test_v2i16tov2i32() { +; CHECK: test_v2i16tov2i32: + + %i16val = load <2 x i16>* @var_v2i16 + + %i32val = sext <2 x i16> %i16val to <2 x i32> + store <2 x i32> %i32val, <2 x i32>* @var_v2i32 +; CHECK: vld1.32 {d[[LOAD:[0-9]+]][0]}, [{{r[0-9]+}}, :32] +; CHECK: vmovl.s16 {{q[0-9]+}}, d[[LOAD]] +; CHECK-NOT: vmovl + + ret void +; CHECK: bx lr +} + +define void @test_v2i16tov2i64() { +; CHECK: test_v2i16tov2i64: + + %i16val = load <2 x i16>* @var_v2i16 + + %i64val = sext <2 x i16> %i16val to <2 x i64> + store <2 x i64> %i64val, <2 x i64>* @var_v2i64 +; CHECK: vld1.32 {d[[LOAD:[0-9]+]][0]}, [{{r[0-9]+}}, :32] +; CHECK: vmovl.s16 {{q[0-9]+}}, d[[LOAD]] +; CHECK: vmovl.s32 {{q[0-9]+}}, d[[LOAD]] + + ret void +} Propchange: llvm/trunk/test/CodeGen/ARM/2012-08-09-neon-extload.ll ------------------------------------------------------------------------------ svn:eol-style = native From t.p.northover at gmail.com Mon Aug 13 05:42:21 2012 From: t.p.northover at gmail.com (Tim Northover) Date: Mon, 13 Aug 2012 11:42:21 +0100 Subject: [llvm-commits] [patch] Invalid alignments for NEON loads In-Reply-To: References: Message-ID: Hi Renato, > If you're happy with the amount of tests (and will not get embarrassed > again), I'm ok, too. ;) Thanks. Committed as r161748 and r161750 (bloody "svn add"). > If there's no way to get there and no way to test it and it supposedly > makes no difference on anything else (does it?), why bother? I'm assuming there is a way to get there but I've been insufficiently cunning in my search, or perhaps the pattern that relies on it is in an external repository? The alternatives at this point seem to be to remove it and see if anyone complains or to fix it. Meanwhile I'll write a direct e-mail to Wang in case he missed the CC amongst everything else. Tim. From alexfh at google.com Mon Aug 13 05:43:36 2012 From: alexfh at google.com (Alexander Kornienko) Date: Mon, 13 Aug 2012 10:43:36 -0000 Subject: [llvm-commits] [llvm] r161751 - /llvm/trunk/unittests/Support/CommandLineTest.cpp Message-ID: <20120813104336.558872A6C075@llvm.org> Author: alexfh Date: Mon Aug 13 05:43:36 2012 New Revision: 161751 URL: http://llvm.org/viewvc/llvm-project?rev=161751&view=rev Log: Added test for non-static use of cl::opt (fixed in r160170) Modified: llvm/trunk/unittests/Support/CommandLineTest.cpp Modified: llvm/trunk/unittests/Support/CommandLineTest.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/CommandLineTest.cpp?rev=161751&r1=161750&r2=161751&view=diff ============================================================================== --- llvm/trunk/unittests/Support/CommandLineTest.cpp (original) +++ llvm/trunk/unittests/Support/CommandLineTest.cpp Mon Aug 13 05:43:36 2012 @@ -55,6 +55,17 @@ EXPECT_EQ("hello", EnvironmentTestOption); } +// This test used to make valgrind complain +// ("Conditional jump or move depends on uninitialised value(s)") +TEST(CommandLineTest, ParseEnvironmentToLocalVar) { + // Put cl::opt on stack to check for proper initialization of fields. + cl::opt EnvironmentTestOptionLocal("env-test-opt-local"); + TempEnvVar TEV(test_env_var, "-env-test-opt-local=hello-local"); + EXPECT_EQ("", EnvironmentTestOptionLocal); + cl::ParseEnvironmentOptions("CommandLineTest", test_env_var); + EXPECT_EQ("hello-local", EnvironmentTestOptionLocal); +} + #endif // SKIP_ENVIRONMENT_TESTS } // anonymous namespace From alexfh at google.com Mon Aug 13 05:46:16 2012 From: alexfh at google.com (Alexander Kornienko) Date: Mon, 13 Aug 2012 12:46:16 +0200 Subject: [llvm-commits] [llvm] r160170 - /llvm/trunk/include/llvm/Support/CommandLine.h In-Reply-To: <5028B9FC.8040206@free.fr> References: <20120713125523.55FAC2A6C06D@llvm.org> <50001D6E.7070105@free.fr> <5028B9FC.8040206@free.fr> Message-ID: Committed as r161751. On Mon, Aug 13, 2012 at 10:25 AM, Duncan Sands wrote: > LGTM. Ciao, Duncan. > > > On 23/07/12 19:52, Alexander Kornienko wrote: > >> I've added a test that shows a condition when my patch helps. >> It fails under valgrind with rev 160170 reverted: >> >> $ svn merge -r 160170:160169 https://llvm.org/svn/llvm-** >> project/llvm/trunk >> $ cd your-build-dir >> $ make check-all >> $ valgrind unittests/Support/SupportTests >> ... >> [ RUN ] CommandLineTest.**ParseEnvironmentToLocalVar >> ==12673== Conditional jump or move depends on uninitialised value(s) >> ==12673== at 0x659A17: >> GetOptionInfo(llvm::**SmallVectorImpl&, >> llvm::SmallVectorImpl&, >> llvm::StringMap&) (in >> /usr/local/google/users/**alexfh/cmake-clang-build/** >> unittests/Support/**SupportTests) >> ==12673== by 0x657E27: llvm::cl::**ParseCommandLineOptions(int, >> char const* >> const*, char const*, bool) (in >> /usr/local/google/users/**alexfh/cmake-clang-build/** >> unittests/Support/**SupportTests) >> ==12673== by 0x657B70: llvm::cl::**ParseEnvironmentOptions(char >> const*, >> char const*, char const*, bool) (in >> /usr/local/google/users/**alexfh/cmake-clang-build/** >> unittests/Support/**SupportTests) >> ==12673== by 0x495B2F: (anonymous >> namespace)::CommandLineTest_**ParseEnvironmentToLocalVar_**Test::TestBody() >> (in >> /usr/local/google/users/**alexfh/cmake-clang-build/** >> unittests/Support/**SupportTests) >> ... >> >> With rev 160170 in place this valgrind message isn't triggered: >> >> $ svn revert include/llvm/Support/**CommandLine.h >> $ cd your-build-dir >> $ make check-all >> $ valgrind unittests/Support/SupportTests >> ... >> [ RUN ] CommandLineTest.**ParseEnvironmentToLocalVar >> [ OK ] CommandLineTest.**ParseEnvironmentToLocalVar (10 ms) >> ... >> >> There are also a few tests in tools/clang/tests/Tooling that fail on >> their own >> (i.e. without valgrind) without rev 160170, but these failures highly >> depend on >> external conditions and surrounding code layout (however, valgrind >> consistently >> finds issues even if the code doesn't break). >> >> Is it enough to prove validity of my previous patch? >> >> >> On Mon, Jul 16, 2012 at 3:28 PM, Chandler Carruth > > wrote: >> >> On Mon, Jul 16, 2012 at 6:24 AM, Alexander Kornienko < >> alexfh at google.com >> > wrote: >> >> On Mon, Jul 16, 2012 at 3:10 PM, Chandler Carruth < >> chandlerc at google.com >> > wrote: >> >> On Mon, Jul 16, 2012 at 6:02 AM, Alexander Kornienko >> > wrote: >> >> >> On Fri, Jul 13, 2012 at 3:06 PM, Duncan Sands < >> baldrick at free.fr >> > wrote: >> >> Hi Alexander, >> > Initializers for some fields were missing in >> Option::Option >> >> did it matter? If so, please add a testcase. If >> not, why >> this change? >> >> This did matter. It caused random crashes in case cl::opt >> was a >> member of non-POD class. >> >> >> Hold on, a *member*? 'cl::opt' objects are supposed to be >> globals, >> not members. >> >> We need it as a member to make a class which handles a common >> subset of >> command-line options for several clang tools. In a close future >> we'll >> need a control on which options should be enabled and which not. >> So we >> can't do it with global variables. Why can't we use it as a >> member? >> >> >> Errr... Ok, this is something we should discuss in more depth. >> >> Essentially, it's not that you necessarily can't, it's that the >> library was >> never designed with that use case in mind. It's completely outside the >> contract of the library, and so random things are likely to continue >> breaking. If this the correct design, we need to at least extend the >> library >> with unittests to check its behavior in that context. These unittests >> would >> then be what you would run under Valgrind in order to detect the >> failure. >> >> >> >> >> -- >> Alexander Kornienko | Software Engineer |alexfh at google.com >> |+49 151 221 77 957 >> >> Google Germany GmbH | Dienerstr. 12 | 80331 M?nchen >> >> > -- Best regards, Alexander Kornienko -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/513c1b3d/attachment-0001.html From samsonov at google.com Mon Aug 13 06:23:40 2012 From: samsonov at google.com (Alexey Samsonov) Date: Mon, 13 Aug 2012 11:23:40 -0000 Subject: [llvm-commits] [compiler-rt] r161754 - in /compiler-rt/trunk/lib/asan: asan_interface.h asan_report.cc tests/asan_noinst_test.cc Message-ID: <20120813112340.B3CBA2A6C075@llvm.org> Author: samsonov Date: Mon Aug 13 06:23:40 2012 New Revision: 161754 URL: http://llvm.org/viewvc/llvm-project?rev=161754&view=rev Log: [ASan] Add __asan_set_on_error_callback() interface function that allows user to set a callback to be called right when ASan detects an error Modified: compiler-rt/trunk/lib/asan/asan_interface.h compiler-rt/trunk/lib/asan/asan_report.cc compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Modified: compiler-rt/trunk/lib/asan/asan_interface.h URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface.h?rev=161754&r1=161753&r2=161754&view=diff ============================================================================== --- compiler-rt/trunk/lib/asan/asan_interface.h (original) +++ compiler-rt/trunk/lib/asan/asan_interface.h Mon Aug 13 06:23:40 2012 @@ -118,6 +118,13 @@ void __asan_set_error_report_callback(void (*callback)(const char*)) SANITIZER_INTERFACE_ATTRIBUTE; + // Sets the callback to be called right when ASan detects an error. + // This can be used to notice cases when ASan detects an error, but the + // program crashes before ASan report is printed. + // Passing 0 unsets the callback. + void __asan_set_on_error_callback(void (*callback)(void)) + SANITIZER_INTERFACE_ATTRIBUTE; + // Returns the estimated number of bytes that will be reserved by allocator // for request of "size" bytes. If ASan allocator can't allocate that much // memory, returns the maximal possible allocation size, otherwise returns Modified: compiler-rt/trunk/lib/asan/asan_report.cc URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.cc?rev=161754&r1=161753&r2=161754&view=diff ============================================================================== --- compiler-rt/trunk/lib/asan/asan_report.cc (original) +++ compiler-rt/trunk/lib/asan/asan_report.cc Mon Aug 13 06:23:40 2012 @@ -21,7 +21,7 @@ namespace __asan { -// ---------------------- Error report callback ------------------- {{{1 +// -------------------- User-specified callbacks ----------------- {{{1 static void (*error_report_callback)(const char*); static char *error_message_buffer = 0; static uptr error_message_buffer_pos = 0; @@ -40,6 +40,8 @@ } } +static void (*on_error_callback)(void); + // ---------------------- Helper functions ----------------------- {{{1 static void PrintBytes(const char *before, uptr *a) { @@ -219,6 +221,9 @@ SleepForSeconds(Max(5, flags()->sleep_before_dying + 1)); Die(); } + if (on_error_callback) { + on_error_callback(); + } AsanPrintf("====================================================" "=============\n"); AsanThread *curr_thread = asanThreadRegistry().GetCurrent(); @@ -409,3 +414,7 @@ error_message_buffer_pos = 0; } } + +void NOINLINE __asan_set_on_error_callback(void (*callback)(void)) { + on_error_callback = callback; +} Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=161754&r1=161753&r2=161754&view=diff ============================================================================== --- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original) +++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Mon Aug 13 06:23:40 2012 @@ -530,6 +530,12 @@ __asan_set_death_callback(NULL); } +TEST(AddressSanitizerInterface, OnErrorCallbackTest) { + __asan_set_on_error_callback(MyDeathCallback); + EXPECT_DEATH(DoDoubleFree(), "MyDeathCallback.*double-free"); + __asan_set_on_error_callback(NULL); +} + static const char* kUseAfterPoisonErrorMessage = "use-after-poison"; #define GOOD_ACCESS(ptr, offset) \ From jush.msn at gmail.com Mon Aug 13 06:59:54 2012 From: jush.msn at gmail.com (Jush Lu) Date: Mon, 13 Aug 2012 19:59:54 +0800 Subject: [llvm-commits] [PATCH] Add support for fast calling convention In-Reply-To: References: <510AFFD8-2673-4B25-A3A6-E702B7C01E8E@apple.com> Message-ID: Hi, fastcc uses FastCC_ARM_APCS (not CC_ARM_APCS) if targets don't support AAPCS ABI, and FastCC_ARM_APCS is specific to fastcc, that is, if we merge it into CallingConv::C, there will be extra checks caused by FastCC_ARM_APCS when we handle CallingConv::C, but CallingConv::C doesn't need these checks. In general, we use CallingConv::C much, and fastcc is rare, this will be unnecessary overhead to CallingConv::C, and we just move similar checks from fasctcc to CCC. For the fast-isel-fastcc.patch attached in this email, I add test cases for {VFP, noVFP} x {fastcc, no fastcc}, no changes for rest. Jush On Sat, Aug 11, 2012 at 2:20 AM, Renato Golin wrote: > On 10 August 2012 12:25, Jush Lu wrote: > > Hi all, > > > > As Renato's suggestion, I split the last patch into two patches. > > It was actually Chad's suggestion, I just agreed with him... :D > > > > 'fast-isel-fastcc.patch' is for fix, and another is for clean up. > > The clean-up is harmless, and should pose no problems. However, it > seems you ended up with two implementations of the same thing (sorry I > missed that in the first review). > > AFAIK, fastcc in ARM is the same as AAPCS, so there is no point in > having two similar logics for both. The original implementation, > though, seemed to be wrong assuming "fastcc" (like CCC) should be > default to APCS, rather than AAPCS. > > I think the best course of action is to common up the two > implementations (ie. leave the fall through as it is), by adding > yet-another test in the end (and on ABI check), taking (CC == > CallingConv::Fast) into consideration. > > And add the working version of the tests, for completeness. > > -- > cheers, > --renato > > http://systemcall.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/f3d61536/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: fast-isel-fastcc.patch Type: application/octet-stream Size: 3340 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/f3d61536/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: fast-isel-simplify-if.patch Type: application/octet-stream Size: 1154 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/f3d61536/attachment-0001.obj From James.Molloy at arm.com Mon Aug 13 08:43:22 2012 From: James.Molloy at arm.com (James Molloy) Date: Mon, 13 Aug 2012 14:43:22 +0100 Subject: [llvm-commits] [PATCH] Fix assertion failure with shufflevectors on ARM Message-ID: <1344865402.6429.16.camel@e102212-lin> Hi, The attached patch fixes an assertion failure in the DAGCombiner. The testcase is simply three shufflevectors. The DAGCombiner tries to optimise a BUILD_VECTOR by checking if it consists purely of get_vector_elts from one or two source vectors. If so, it either makes a concat_vectors node or a shufflevector node. However, it doesn't check the element type width of the underlying vector, so if you have this sequence: [0] v4i16 = ... [1] i32 = extract_vector_elt [0] [2] i32 = extract_vector_elt [0] [3] v16i8 = BUILD_VECTOR [1], [2], ... It will attempt to: [0] v4i16 = ... [1] v16i8 = concat_vectors [0], ... Where this is actually invalid because the element width is completely different. This causes an assertion failure down the line. My fix for this, I'm reasonably happy with. However the fix (bail out if element width is incorrect) causes another bug further down the line. You have this code: [0] v4i16 = ... [1] i16 = get_vector_elt [0] [2] i8 = truncate [0] [3] v16i8 = BUILD_VECTOR [2], ... It gets legalized (because vectors of i8 are not valid on ARM NEON), to something like: [0] v4i16 = ... [1] i16 = get_vector_elt [0] [2] v16i8 = BUILD_VECTOR [1], ... [3] i8 = truncate [0] Note that [3] is an orphan node. This orphan node is traversed in LegalizeDAG() and causes an assertion failure because it is not legal. This is where my SelectionDAG-fu gets rusty. I believe it is due to DAG.RemoveDeadNodes() not having fired, which should remove that node completely and stop the combiner from attempting to legalize it. The patch attached does that simply by moving the call to RemoveDeadNodes() inside its parent loop. I'm not convinced this is the neatest solution however - I'm convinced there must be some reason why that orphan node isn't being removed at the right place. But I don't know some of the internal contracts in SelectionDAG too well, so I'm not sure. Could someone with more knowledge about SelectionDAG please look at whether there is a contract being broken somewhere as opposed to a dead node not being cleaned up quickly enough? Cheers, James -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -------------- next part -------------- A non-text attachment was scrubbed... Name: crash-shufflevector.patch Type: text/x-patch Size: 2436 bytes Desc: crash-shufflevector.patch Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/1eb245a7/attachment.bin From rafael.espindola at gmail.com Mon Aug 13 08:51:18 2012 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 13 Aug 2012 09:51:18 -0400 Subject: [llvm-commits] [patch] Add dominance computation for edges In-Reply-To: <5028B97D.7030303@free.fr> References: <5028B97D.7030303@free.fr> Message-ID: On 13 August 2012 04:23, Duncan Sands wrote: > Hi Rafael, .. > maybe this is useful for GVN's replaceAllDominatedUsesWith and/or > isOnlyReachableViaThisEdge? That is why I have done it :-) I have posted a patch that uses it with replaceAllDominatedUsesWith. I have kept isOnlyReachableViaThisEdge as a fast approximation. > Ciao, Duncan. Cheers, Rafael From samsonov at google.com Mon Aug 13 09:05:01 2012 From: samsonov at google.com (Alexey Samsonov) Date: Mon, 13 Aug 2012 14:05:01 -0000 Subject: [llvm-commits] [compiler-rt] r161756 - /compiler-rt/trunk/lib/asan/asan_rtl.cc Message-ID: <20120813140501.1D9D8352404C@llvm.org> Author: samsonov Date: Mon Aug 13 09:05:00 2012 New Revision: 161756 URL: http://llvm.org/viewvc/llvm-project?rev=161756&view=rev Log: [ASan] add __asan_set_on_error_callback into force_interface_symbols (thanks to cool test by glider@) Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=161756&r1=161755&r2=161756&view=diff ============================================================================== --- compiler-rt/trunk/lib/asan/asan_rtl.cc (original) +++ compiler-rt/trunk/lib/asan/asan_rtl.cc Mon Aug 13 09:05:00 2012 @@ -241,6 +241,7 @@ case 27: __asan_set_error_exit_code(0); break; case 28: __asan_stack_free(0, 0, 0); break; case 29: __asan_stack_malloc(0, 0); break; + case 30: __asan_set_on_error_callback(0); break; } } From kcc at google.com Mon Aug 13 09:08:46 2012 From: kcc at google.com (Kostya Serebryany) Date: Mon, 13 Aug 2012 14:08:46 -0000 Subject: [llvm-commits] [llvm] r161757 - /llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Message-ID: <20120813140846.756F4352404C@llvm.org> Author: kcc Date: Mon Aug 13 09:08:46 2012 New Revision: 161757 URL: http://llvm.org/viewvc/llvm-project?rev=161757&view=rev Log: [asan] remove the code for --asan-merge-callbacks as it appears to be a bad idea. (partly related to Bug 13225) Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=161757&r1=161756&r2=161757&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Mon Aug 13 09:08:46 2012 @@ -86,9 +86,6 @@ static cl::opt ClInstrumentAtomics("asan-instrument-atomics", cl::desc("instrument atomic instructions (rmw, cmpxchg)"), cl::Hidden, cl::init(true)); -static cl::opt ClMergeCallbacks("asan-merge-callbacks", - cl::desc("merge __asan_report_ callbacks to create fewer BBs"), - cl::Hidden, cl::init(false)); // This flag limits the number of instructions to be instrumented // in any given BB. Normally, this should be set to unlimited (INT_MAX), // but due to http://llvm.org/bugs/show_bug.cgi?id=12652 we temporary @@ -145,24 +142,11 @@ namespace { -/// When the crash callbacks are merged, they receive some amount of arguments -/// that are merged in a PHI node. This struct represents arguments from one -/// call site. -struct CrashArg { - Value *Arg1; - Value *Arg2; -}; - /// An object of this type is created while instrumenting every function. struct AsanFunctionContext { - AsanFunctionContext(Function &Function) : F(Function), CrashBlock() { } + AsanFunctionContext(Function &Function) : F(Function) { } Function &F; - // These are initially zero. If we require at least one call to - // __asan_report_{read,write}{1,2,4,8,16}, an appropriate BB is created. - BasicBlock *CrashBlock[2][kNumberOfAccessSizes]; - typedef SmallVector CrashArgsVec; - CrashArgsVec CrashArgs[2][kNumberOfAccessSizes]; }; /// AddressSanitizer: instrument the code in module to find memory bugs. @@ -457,34 +441,12 @@ Value *Cmp = IRB.CreateICmpNE(ShadowValue, CmpVal); - BasicBlock *CrashBlock = 0; - if (ClMergeCallbacks) { - size_t AccessSizeIndex = TypeSizeToSizeIndex(TypeSize); - BasicBlock **Cached = &AFC.CrashBlock[IsWrite][AccessSizeIndex]; - if (!*Cached) { - std::string BBName("crash_bb-"); - BBName += (IsWrite ? "w-" : "r-") + itostr(1 << AccessSizeIndex); - BasicBlock *BB = BasicBlock::Create(*C, BBName, &AFC.F); - new UnreachableInst(*C, BB); - *Cached = BB; - } - CrashBlock = *Cached; - // We need to pass the PC as the second parameter to __asan_report_*. - // There are few problems: - // - Some architectures (e.g. x86_32) don't have a cheap way to get the PC. - // - LLVM doesn't have the appropriate intrinsic. - // For now, put a random number into the PC, just to allow experiments. - Value *PC = ConstantInt::get(IntptrTy, rand()); - CrashArg Arg = {AddrLong, PC}; - AFC.CrashArgs[IsWrite][AccessSizeIndex].push_back(Arg); - } else { - CrashBlock = BasicBlock::Create(*C, "crash_bb", &AFC.F); - new UnreachableInst(*C, CrashBlock); - size_t AccessSizeIndex = TypeSizeToSizeIndex(TypeSize); - Instruction *Crash = - generateCrashCode(CrashBlock, AddrLong, 0, IsWrite, AccessSizeIndex); - Crash->setDebugLoc(OrigIns->getDebugLoc()); - } + BasicBlock *CrashBlock = BasicBlock::Create(*C, "crash_bb", &AFC.F); + new UnreachableInst(*C, CrashBlock); + size_t AccessSizeIndex = TypeSizeToSizeIndex(TypeSize); + Instruction *Crash = + generateCrashCode(CrashBlock, AddrLong, 0, IsWrite, AccessSizeIndex); + Crash->setDebugLoc(OrigIns->getDebugLoc()); size_t Granularity = 1 << MappingScale; if (TypeSize < 8 * Granularity) { @@ -694,12 +656,7 @@ std::string FunctionName = std::string(kAsanReportErrorTemplate) + (AccessIsWrite ? "store" : "load") + itostr(1 << AccessSizeIndex); // If we are merging crash callbacks, they have two parameters. - if (ClMergeCallbacks) - AsanErrorCallback[AccessIsWrite][AccessSizeIndex] = cast( - M.getOrInsertFunction(FunctionName, IRB.getVoidTy(), IntptrTy, - IntptrTy, NULL)); - else - AsanErrorCallback[AccessIsWrite][AccessSizeIndex] = cast( + AsanErrorCallback[AccessIsWrite][AccessSizeIndex] = cast( M.getOrInsertFunction(FunctionName, IRB.getVoidTy(), IntptrTy, NULL)); } } @@ -845,33 +802,6 @@ NumInstrumented++; } - // Create PHI nodes and crash callbacks if we are merging crash callbacks. - if (NumInstrumented) { - for (size_t IsWrite = 0; IsWrite <= 1; IsWrite++) { - for (size_t AccessSizeIndex = 0; AccessSizeIndex < kNumberOfAccessSizes; - AccessSizeIndex++) { - BasicBlock *BB = AFC.CrashBlock[IsWrite][AccessSizeIndex]; - if (!BB) continue; - assert(ClMergeCallbacks); - AsanFunctionContext::CrashArgsVec &Args = - AFC.CrashArgs[IsWrite][AccessSizeIndex]; - IRBuilder<> IRB(BB->getFirstNonPHI()); - size_t n = Args.size(); - PHINode *PN1 = IRB.CreatePHI(IntptrTy, n); - PHINode *PN2 = IRB.CreatePHI(IntptrTy, n); - // We need to match crash parameters and the predecessors. - for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); - PI != PE; ++PI) { - n--; - PN1->addIncoming(Args[n].Arg1, *PI); - PN2->addIncoming(Args[n].Arg2, *PI); - } - assert(n == 0); - generateCrashCode(BB, PN1, PN2, IsWrite, AccessSizeIndex); - } - } - } - DEBUG(dbgs() << F); bool ChangedStack = poisonStackInFunction(M, F); From tyler.nowicki at intel.com Mon Aug 13 09:20:36 2012 From: tyler.nowicki at intel.com (Nowicki, Tyler) Date: Mon, 13 Aug 2012 14:20:36 +0000 Subject: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization In-Reply-To: <12AD2503-E466-4939-92AD-F1B49F4F5144@apple.com> References: <5D9317A7-8E01-42B5-BAA2-55822928E528@apple.com> <08A93BB5-8481-43F5-A19B-9D2A1788329B@apple.com> <601DDF@apple.com> <12AD2503-E466-4939-92AD-F1B49F4F5144@apple.com> Message-ID: Sorry for the delayed response. This sounds like the right place. I've attached a patch for a CodeGenPrep pass that bypasses slow division operations when the target indicates that smaller divisions are cheaper. Thanks, Tyler > -----Original Message----- > From: Evan Cheng [mailto:evan.cheng at apple.com] > Sent: Sunday, August 05, 2012 7:01 PM > To: Nowicki, Tyler > Cc: llvm-commits at cs.uiuc.edu > Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > > Another possibility would be to make this transformation generic. It might > make sense to put it in CodeGenPrep under control of some target hook. > CodeGenPrep is the place where IR is being modified before it goes through > codegen and it is allowed to do have some target specific knowledge. > > Evan > > On Aug 5, 2012, at 11:10 AM, Evan Cheng wrote: > > > > > On Aug 3, 2012, at 3:30 PM, Nowicki, Tyler wrote: > > > >> Let me clarify how this optimization works. Instead of > >> > >> result = dividend/divisor; > >> > >> an application programmer looking for optimal performance, targeting > Atom CPUs, without this optimization would have to write: > >> > >> if (((dividend | divisor) & 0xFF) < 0) { result = (char)dividend / > >> (char)divisor; //fast divide } else { result = dividend / divisor; > >> //slow divide } > > > > Yes I understand. You want a simple division to be expanded into code that > involves multiple BB and control flows. > > > >> > >> I still want the both the fast and slow divide to go through normal isel. But > what you are suggesting significantly changes the way DIVs are handled for > Atom CPUs, specifically avoiding the UDIVREM/SDIVREM expansion! Are you > suggesting that I duplicate this code in a custom inserter function? > > > > No, you would custom lower sdiv / udiv / srem / urem nodes so UDIVREM / > SDIVREM code will never be formed. The custom inserter function create > MachineInstr, not SDNodes. > > > > Evan > > > >> > >> Tyler > >> > >>> -----Original Message----- > >>> From: Evan Cheng [mailto:evan.cheng at apple.com] > >>> Sent: Friday, August 03, 2012 6:07 PM > >>> To: Nowicki, Tyler > >>> Cc: llvm-commits at cs.uiuc.edu > >>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > >>> > >>> > >>> On Aug 3, 2012, at 2:28 PM, Nowicki, Tyler wrote: > >>> > >>>> This optimization should not be classified as `instruction > >>>> selection'. We're not > >>> simply replacing one form of divide with another at compilation > >>> time. The optimization adds control flow to use an 8-bit DIV when > >>> the values of the operands are determined to be small enough during > program execution. > >>> > >>> It is instruction selection. This is about selecting the optimal > >>> code sequence to implement an operation. > >>> > >>>> > >>>> Several approaches were looked at for this optimization and the IR > >>>> pass was > >>> found to be the best way to accomplish it. Here are the approaches > >>> that we looked at and the reasons they are not suitable for this > optimization. > >>>> > >>>> 1. Using a custom lowering function Specifying a custom lowering > >>>> function for ISD::UDIV/UREM/etc instructions > >>> using setOperationAction(...) in X86ISelLowering. However, the > >>> lowering functions are limited to using a SelectionDAG. Because the > >>> optimization requires several new BBs to be added it is not possible > >>> to add it here. Is this the place you were thinking of? > >>>> > >>>> 2. Using a custom inserter > >>>> Marking appropriate instructions with usesCustomInserter in > >>>> tablegen and > >>> implementing the optimization by inserting several new > >>> MachineBasicBlocks. As said previously ISD::UDIVREM/SDIVREM are > >>> expanded into multiple instructions, see X86ISelDAGToDAG:2301. > >>> Adding it here would require the inserted instructions to be > >>> identified, removed, and a similar set of instructions to be added > >>> for the fast and slow DIV cases. However, this cannot be easily done > >>> because there are no guarantees how UDIVREM/SDIVREM will be > expanded > >>> or in what order, and inserting the fast and slow DIVs here would > essentially require duplicating the UDIVREM/SDIVREM expansion code. > >>> > >>> You want to use combination of 1 and 2. Custom lower into a target > >>> specific node which will map to a pseudo instruction marked with > usesCustomInserter. > >>> That allows you to create new BBs. There are lots of examples, e.g. > atomic ops. > >>> > >>> Evan > >>> > >>>> > >>>> 3. Other approaches > >>>> We want the UDIVREM/SDIVREM expansion to operate on the original > >>>> DIV > >>> instruction and the DIV this optimization inserts so it seems like > >>> this optimization could be implemented in > >>> X86DAGToDAGISel::PreprocessISelDAG. Can we add control flow at this > point? > >>>> > >>>> Tyler Nowicki > >>>> Intel > >>>> > >>>>> -----Original Message----- > >>>>> From: Evan Cheng [mailto:evan.cheng at apple.com] > >>>>> Sent: Wednesday, August 01, 2012 4:38 PM > >>>>> To: Nowicki, Tyler > >>>>> Cc: llvm-commits at cs.uiuc.edu > >>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > >>>>> > >>>>> > >>>>> On Aug 1, 2012, at 11:58 AM, "Nowicki, Tyler" > >>>>> > >>>>> wrote: > >>>>> > >>>>>> I don't understand what you are suggesting. > >>>>>> > >>>>>> ISD::SDIV, ISD::SREM and ISD::UDIV, ISD::UREM are combined to > >>>>>> form > >>>>> ISD::SDIVREM, and ISD::UDIVREM. These are handled by > >>>>> X86ISelDAGToDAG:2301 which takes care of all the special cases by > >>>>> inserting the appropriate movs, cdq/cwd, and X86::DIV or X86::IDIV > >>>>> instructions. A custom inserter is invoked after this, but it's > >>>>> too late because the div/rem operations have been replaced by > >>>>> numerous > >>> instructions. > >>>>> > >>>>> Looks like you don't understand how LLVM instruction works. Please > >>>>> spend some time looking at the passes in isel, especially how > >>>>> targets do custom lowering. Basically you want to lower these ISD > >>>>> nodes before they reach X86ISelDAGToDAG. > >>>>> > >>>>>> > >>>>>> What is wrong with doing this in a backend IR pass? > >>>>> > >>>>> Because this is a target specific instruction selection issue and > >>>>> it doesn't belong in LLVM IR level. We don't want arbitrary IR > >>>>> passes to do bits and pieces of optimization. > >>>>> > >>>>> Evan > >>>>> > >>>>>> > >>>>>> Tyler > >>>>>> > >>>>>>> -----Original Message----- > >>>>>>> From: Evan Cheng [mailto:evan.cheng at apple.com] > >>>>>>> Sent: Wednesday, August 01, 2012 2:18 PM > >>>>>>> To: Nowicki, Tyler > >>>>>>> Cc: llvm-commits at cs.uiuc.edu > >>>>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > >>>>>>> > >>>>>>> > >>>>>>> On Aug 1, 2012, at 9:18 AM, "Nowicki, Tyler" > >>>>>>> > >>>>>>> wrote: > >>>>>>> > >>>>>>>> Thanks for the reply. > >>>>>>>> > >>>>>>>> Lower is too late because DIV gets expanded into 2 MOV, a CDQ > >>>>>>>> or CWD, the DIV or IDIV, and one or two more MOVs during > >>>>>>>> instruction selection on DAG conversion in X86ISelDAGToDAG. > >>>>>>>> Adding > >>>>>>> > >>>>>>> Not during X86ISelDAGToDAG. You should do this using custom > >>>>>>> lowering in X86ISelLowering. At that time, it just looks like a > >>>>>>> ISD::SDIV / > >>> UDIV node. > >>>>>>> > >>>>>>>> this optimization after would require a custom inserter to > >>>>>>>> search and remove > >>>>>>> these instructions, and generate new BBs. This is complicated by > >>>>>>> O2 optimization which may remove MOVs when possible, by the > >>>>>>> scheduler on Atom which changes the order of instructions to > >>>>>>> avoid stalls, and by which form of the DIV instruction is used. > >>>>>>> Also, depending on the spills and neighboring instructions it is > >>>>>>> difficult to enumerate all the possible ways this optimization can be > carried out. > >>>>>>> > >>>>>>> The right thing to do is to custom lower into a X86ISD target > >>>>>>> node and select to a pseudo instruction. It can be marked with > >>>>>>> usesCustomInserter = 1 which allows you to expand it into the > >>>>>>> machine > >>>>> instructions and create new BBs if needed. > >>>>>>> > >>>>>>>> > >>>>>>>> It makes sense to do the optimization as an IR pass because > >>>>>>>> none of this has > >>>>>>> happened yet. Then CSE and scheduling can operate on the new > BBs. > >>>>>>> > >>>>>>> Scheduling doesn't happen until later and machine CSE can handle > >>>>>>> these instructions. Please look at some examples to learn more > >>>>>>> about how existing targets handle complex cases. > >>>>>>> > >>>>>>> Evan > >>>>>>> > >>>>>>>> > >>>>>>>> Thanks, > >>>>>>>> > >>>>>>>> Tyler > >>>>>>>> > >>>>>>>>> -----Original Message----- > >>>>>>>>> From: Evan Cheng [mailto:evan.cheng at apple.com] > >>>>>>>>> Sent: Tuesday, July 31, 2012 6:41 PM > >>>>>>>>> To: Nowicki, Tyler > >>>>>>>>> Cc: Eli Friedman; llvm-commits at cs.uiuc.edu > >>>>>>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom > >>>>>>>>> Optimization > >>>>>>>>> > >>>>>>>>> Hi Tyler, > >>>>>>>>> > >>>>>>>>> This doesn't look like the right approach. I don't understand > >>>>>>>>> why you are adding a LLVM ir pass to do the expansion. Why > >>>>>>>>> can't this be done at x86 instruction lowering time? > >>>>>>>>> > >>>>>>>>> Evan > >>>>>>>>> > >>>>>>>>> On Jul 31, 2012, at 1:25 PM, "Nowicki, Tyler" > >>>>>>>>> > >>>>>>>>> wrote: > >>>>>>>>> > >>>>>>>>>> Thanks for the review. Good catch on the missing check, I've > >>>>>>>>>> also made use > >>>>>>>>> of DenseMap as suggested. Test cases omitted from the > >>>>>>>>> previously patch are in place again and a test case for the > >>>>>>>>> missing check you found has been added. > >>>>>>>>>> > >>>>>>>>>> Please review my corrections. > >>>>>>>>>> > >>>>>>>>>> Tyler Nowicki > >>>>>>>>>> Intel > >>>>>>>>>> > >>>>>>>>>>> -----Original Message----- > >>>>>>>>>>> From: Eli Friedman [mailto:eli.friedman at gmail.com] > >>>>>>>>>>> Sent: Friday, July 27, 2012 2:17 PM > >>>>>>>>>>> To: Nowicki, Tyler > >>>>>>>>>>> Cc: Sean Silva; llvm-commits at cs.uiuc.edu > >>>>>>>>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom > >>>>>>>>>>> Optimization > >>>>>>>>>>> > >>>>>>>>>>> On Fri, Jul 27, 2012 at 8:35 AM, Nowicki, Tyler > >>>>>>>>>>> > >>>>>>>>>>> wrote: > >>>>>>>>>>>> This patch has not yet been reviewed. Could someone take a > >>>>>>>>>>>> look at > >>>>> it? > >>>>>>>>>>> > >>>>>>>>>>> + typedef std::pair DivBOperands; > >>>>>>>>>>> + //Dividend > >>>>>>>>>>> Value, Divisor Value > >>>>>>>>>>> + typedef std::pair DivBPhiNodes; > >>>>>>>>>>> + //Quotient > >>>>>>>>>>> PHI, Remainder Phi > >>>>>>>>>>> + typedef std::map > >>>>>>>>>>> + DivBCacheTy; > >>>>>>>>>>> > >>>>>>>>>>> llvm::DenseMap? > >>>>>>>>>>> > >>>>>>>>>>> + // Replace operation value with previously generated phi > >>>>>>>>>>> + node DivBPhiNodes Value = CacheI->second; if (UseDivOp) { > >>>>>>>>>>> + // Replace all uses of div instruction with quotient phi node > >>>>>>>>>>> + J->replaceAllUsesWith(Value.first); > >>>>>>>>>>> + } else { > >>>>>>>>>>> + // Replace all uses of rem instruction with remainder phi > node > >>>>>>>>>>> + J->replaceAllUsesWith(Value.second); > >>>>>>>>>>> + } > >>>>>>>>>>> > >>>>>>>>>>> Looks like there's a missing check for UseSignedOp here. > >>>>>>>>>>> > >>>>>>>>>>> The patch doesn't appear to include any testcases. > >>>>>>>>>>> > >>>>>>>>>>> -Eli > >>>>>>>>>> >>>>>>>>> > >>> svn.patch>_______________________________________________ > >>>>>>>>>> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: BypassSlowDiv5.patch Type: application/octet-stream Size: 21214 bytes Desc: BypassSlowDiv5.patch Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/7d437b40/attachment.obj From tyler.nowicki at intel.com Mon Aug 13 09:35:51 2012 From: tyler.nowicki at intel.com (Nowicki, Tyler) Date: Mon, 13 Aug 2012 14:35:51 +0000 Subject: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization In-Reply-To: References: <5D9317A7-8E01-42B5-BAA2-55822928E528@apple.com> <08A93BB5-8481-43F5-A19B-9D2A1788329B@apple.com> <601DDF@apple.com> <12AD2503-E466-4939-92AD-F1B49F4F5144@apple.com> Message-ID: My apologies, that was not an SVN patch. Here is the correct patch. Tyler > -----Original Message----- > From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits- > bounces at cs.uiuc.edu] On Behalf Of Nowicki, Tyler > Sent: Monday, August 13, 2012 10:21 AM > To: Evan Cheng > Cc: llvm-commits at cs.uiuc.edu > Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > > Sorry for the delayed response. This sounds like the right place. I've attached > a patch for a CodeGenPrep pass that bypasses slow division operations when > the target indicates that smaller divisions are cheaper. > > Thanks, > > Tyler > > > -----Original Message----- > > From: Evan Cheng [mailto:evan.cheng at apple.com] > > Sent: Sunday, August 05, 2012 7:01 PM > > To: Nowicki, Tyler > > Cc: llvm-commits at cs.uiuc.edu > > Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > > > > Another possibility would be to make this transformation generic. It > > might make sense to put it in CodeGenPrep under control of some target > hook. > > CodeGenPrep is the place where IR is being modified before it goes > > through codegen and it is allowed to do have some target specific > knowledge. > > > > Evan > > > > On Aug 5, 2012, at 11:10 AM, Evan Cheng wrote: > > > > > > > > On Aug 3, 2012, at 3:30 PM, Nowicki, Tyler wrote: > > > > > >> Let me clarify how this optimization works. Instead of > > >> > > >> result = dividend/divisor; > > >> > > >> an application programmer looking for optimal performance, > > >> targeting > > Atom CPUs, without this optimization would have to write: > > >> > > >> if (((dividend | divisor) & 0xFF) < 0) { result = (char)dividend / > > >> (char)divisor; //fast divide } else { result = dividend / divisor; > > >> //slow divide } > > > > > > Yes I understand. You want a simple division to be expanded into > > > code that > > involves multiple BB and control flows. > > > > > >> > > >> I still want the both the fast and slow divide to go through normal > > >> isel. But > > what you are suggesting significantly changes the way DIVs are handled > > for Atom CPUs, specifically avoiding the UDIVREM/SDIVREM expansion! > > Are you suggesting that I duplicate this code in a custom inserter function? > > > > > > No, you would custom lower sdiv / udiv / srem / urem nodes so > > > UDIVREM / > > SDIVREM code will never be formed. The custom inserter function > > create MachineInstr, not SDNodes. > > > > > > Evan > > > > > >> > > >> Tyler > > >> > > >>> -----Original Message----- > > >>> From: Evan Cheng [mailto:evan.cheng at apple.com] > > >>> Sent: Friday, August 03, 2012 6:07 PM > > >>> To: Nowicki, Tyler > > >>> Cc: llvm-commits at cs.uiuc.edu > > >>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > > >>> > > >>> > > >>> On Aug 3, 2012, at 2:28 PM, Nowicki, Tyler wrote: > > >>> > > >>>> This optimization should not be classified as `instruction > > >>>> selection'. We're not > > >>> simply replacing one form of divide with another at compilation > > >>> time. The optimization adds control flow to use an 8-bit DIV when > > >>> the values of the operands are determined to be small enough > > >>> during > > program execution. > > >>> > > >>> It is instruction selection. This is about selecting the optimal > > >>> code sequence to implement an operation. > > >>> > > >>>> > > >>>> Several approaches were looked at for this optimization and the > > >>>> IR pass was > > >>> found to be the best way to accomplish it. Here are the approaches > > >>> that we looked at and the reasons they are not suitable for this > > optimization. > > >>>> > > >>>> 1. Using a custom lowering function Specifying a custom lowering > > >>>> function for ISD::UDIV/UREM/etc instructions > > >>> using setOperationAction(...) in X86ISelLowering. However, the > > >>> lowering functions are limited to using a SelectionDAG. Because > > >>> the optimization requires several new BBs to be added it is not > > >>> possible to add it here. Is this the place you were thinking of? > > >>>> > > >>>> 2. Using a custom inserter > > >>>> Marking appropriate instructions with usesCustomInserter in > > >>>> tablegen and > > >>> implementing the optimization by inserting several new > > >>> MachineBasicBlocks. As said previously ISD::UDIVREM/SDIVREM are > > >>> expanded into multiple instructions, see X86ISelDAGToDAG:2301. > > >>> Adding it here would require the inserted instructions to be > > >>> identified, removed, and a similar set of instructions to be added > > >>> for the fast and slow DIV cases. However, this cannot be easily > > >>> done because there are no guarantees how UDIVREM/SDIVREM will be > > expanded > > >>> or in what order, and inserting the fast and slow DIVs here would > > essentially require duplicating the UDIVREM/SDIVREM expansion code. > > >>> > > >>> You want to use combination of 1 and 2. Custom lower into a target > > >>> specific node which will map to a pseudo instruction marked with > > usesCustomInserter. > > >>> That allows you to create new BBs. There are lots of examples, e.g. > > atomic ops. > > >>> > > >>> Evan > > >>> > > >>>> > > >>>> 3. Other approaches > > >>>> We want the UDIVREM/SDIVREM expansion to operate on the > original > > >>>> DIV > > >>> instruction and the DIV this optimization inserts so it seems like > > >>> this optimization could be implemented in > > >>> X86DAGToDAGISel::PreprocessISelDAG. Can we add control flow at > > >>> this > > point? > > >>>> > > >>>> Tyler Nowicki > > >>>> Intel > > >>>> > > >>>>> -----Original Message----- > > >>>>> From: Evan Cheng [mailto:evan.cheng at apple.com] > > >>>>> Sent: Wednesday, August 01, 2012 4:38 PM > > >>>>> To: Nowicki, Tyler > > >>>>> Cc: llvm-commits at cs.uiuc.edu > > >>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom Optimization > > >>>>> > > >>>>> > > >>>>> On Aug 1, 2012, at 11:58 AM, "Nowicki, Tyler" > > >>>>> > > >>>>> wrote: > > >>>>> > > >>>>>> I don't understand what you are suggesting. > > >>>>>> > > >>>>>> ISD::SDIV, ISD::SREM and ISD::UDIV, ISD::UREM are combined to > > >>>>>> form > > >>>>> ISD::SDIVREM, and ISD::UDIVREM. These are handled by > > >>>>> X86ISelDAGToDAG:2301 which takes care of all the special cases > > >>>>> by inserting the appropriate movs, cdq/cwd, and X86::DIV or > > >>>>> X86::IDIV instructions. A custom inserter is invoked after this, > > >>>>> but it's too late because the div/rem operations have been > > >>>>> replaced by numerous > > >>> instructions. > > >>>>> > > >>>>> Looks like you don't understand how LLVM instruction works. > > >>>>> Please spend some time looking at the passes in isel, especially > > >>>>> how targets do custom lowering. Basically you want to lower > > >>>>> these ISD nodes before they reach X86ISelDAGToDAG. > > >>>>> > > >>>>>> > > >>>>>> What is wrong with doing this in a backend IR pass? > > >>>>> > > >>>>> Because this is a target specific instruction selection issue > > >>>>> and it doesn't belong in LLVM IR level. We don't want arbitrary > > >>>>> IR passes to do bits and pieces of optimization. > > >>>>> > > >>>>> Evan > > >>>>> > > >>>>>> > > >>>>>> Tyler > > >>>>>> > > >>>>>>> -----Original Message----- > > >>>>>>> From: Evan Cheng [mailto:evan.cheng at apple.com] > > >>>>>>> Sent: Wednesday, August 01, 2012 2:18 PM > > >>>>>>> To: Nowicki, Tyler > > >>>>>>> Cc: llvm-commits at cs.uiuc.edu > > >>>>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom > > >>>>>>> Optimization > > >>>>>>> > > >>>>>>> > > >>>>>>> On Aug 1, 2012, at 9:18 AM, "Nowicki, Tyler" > > >>>>>>> > > >>>>>>> wrote: > > >>>>>>> > > >>>>>>>> Thanks for the reply. > > >>>>>>>> > > >>>>>>>> Lower is too late because DIV gets expanded into 2 MOV, a CDQ > > >>>>>>>> or CWD, the DIV or IDIV, and one or two more MOVs during > > >>>>>>>> instruction selection on DAG conversion in X86ISelDAGToDAG. > > >>>>>>>> Adding > > >>>>>>> > > >>>>>>> Not during X86ISelDAGToDAG. You should do this using custom > > >>>>>>> lowering in X86ISelLowering. At that time, it just looks like > > >>>>>>> a ISD::SDIV / > > >>> UDIV node. > > >>>>>>> > > >>>>>>>> this optimization after would require a custom inserter to > > >>>>>>>> search and remove > > >>>>>>> these instructions, and generate new BBs. This is complicated > > >>>>>>> by > > >>>>>>> O2 optimization which may remove MOVs when possible, by the > > >>>>>>> scheduler on Atom which changes the order of instructions to > > >>>>>>> avoid stalls, and by which form of the DIV instruction is used. > > >>>>>>> Also, depending on the spills and neighboring instructions it > > >>>>>>> is difficult to enumerate all the possible ways this > > >>>>>>> optimization can be > > carried out. > > >>>>>>> > > >>>>>>> The right thing to do is to custom lower into a X86ISD target > > >>>>>>> node and select to a pseudo instruction. It can be marked with > > >>>>>>> usesCustomInserter = 1 which allows you to expand it into the > > >>>>>>> machine > > >>>>> instructions and create new BBs if needed. > > >>>>>>> > > >>>>>>>> > > >>>>>>>> It makes sense to do the optimization as an IR pass because > > >>>>>>>> none of this has > > >>>>>>> happened yet. Then CSE and scheduling can operate on the new > > BBs. > > >>>>>>> > > >>>>>>> Scheduling doesn't happen until later and machine CSE can > > >>>>>>> handle these instructions. Please look at some examples to > > >>>>>>> learn more about how existing targets handle complex cases. > > >>>>>>> > > >>>>>>> Evan > > >>>>>>> > > >>>>>>>> > > >>>>>>>> Thanks, > > >>>>>>>> > > >>>>>>>> Tyler > > >>>>>>>> > > >>>>>>>>> -----Original Message----- > > >>>>>>>>> From: Evan Cheng [mailto:evan.cheng at apple.com] > > >>>>>>>>> Sent: Tuesday, July 31, 2012 6:41 PM > > >>>>>>>>> To: Nowicki, Tyler > > >>>>>>>>> Cc: Eli Friedman; llvm-commits at cs.uiuc.edu > > >>>>>>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom > > >>>>>>>>> Optimization > > >>>>>>>>> > > >>>>>>>>> Hi Tyler, > > >>>>>>>>> > > >>>>>>>>> This doesn't look like the right approach. I don't > > >>>>>>>>> understand why you are adding a LLVM ir pass to do the > > >>>>>>>>> expansion. Why can't this be done at x86 instruction lowering > time? > > >>>>>>>>> > > >>>>>>>>> Evan > > >>>>>>>>> > > >>>>>>>>> On Jul 31, 2012, at 1:25 PM, "Nowicki, Tyler" > > >>>>>>>>> > > >>>>>>>>> wrote: > > >>>>>>>>> > > >>>>>>>>>> Thanks for the review. Good catch on the missing check, > > >>>>>>>>>> I've also made use > > >>>>>>>>> of DenseMap as suggested. Test cases omitted from the > > >>>>>>>>> previously patch are in place again and a test case for the > > >>>>>>>>> missing check you found has been added. > > >>>>>>>>>> > > >>>>>>>>>> Please review my corrections. > > >>>>>>>>>> > > >>>>>>>>>> Tyler Nowicki > > >>>>>>>>>> Intel > > >>>>>>>>>> > > >>>>>>>>>>> -----Original Message----- > > >>>>>>>>>>> From: Eli Friedman [mailto:eli.friedman at gmail.com] > > >>>>>>>>>>> Sent: Friday, July 27, 2012 2:17 PM > > >>>>>>>>>>> To: Nowicki, Tyler > > >>>>>>>>>>> Cc: Sean Silva; llvm-commits at cs.uiuc.edu > > >>>>>>>>>>> Subject: Re: [llvm-commits] [PATCH]IDIV->DIVB Atom > > >>>>>>>>>>> Optimization > > >>>>>>>>>>> > > >>>>>>>>>>> On Fri, Jul 27, 2012 at 8:35 AM, Nowicki, Tyler > > >>>>>>>>>>> > > >>>>>>>>>>> wrote: > > >>>>>>>>>>>> This patch has not yet been reviewed. Could someone take > > >>>>>>>>>>>> a look at > > >>>>> it? > > >>>>>>>>>>> > > >>>>>>>>>>> + typedef std::pair DivBOperands; > > >>>>>>>>>>> + //Dividend > > >>>>>>>>>>> Value, Divisor Value > > >>>>>>>>>>> + typedef std::pair DivBPhiNodes; > > >>>>>>>>>>> + //Quotient > > >>>>>>>>>>> PHI, Remainder Phi > > >>>>>>>>>>> + typedef std::map > > >>>>>>>>>>> + DivBCacheTy; > > >>>>>>>>>>> > > >>>>>>>>>>> llvm::DenseMap? > > >>>>>>>>>>> > > >>>>>>>>>>> + // Replace operation value with previously generated > > >>>>>>>>>>> + phi node DivBPhiNodes Value = CacheI->second; if > (UseDivOp) { > > >>>>>>>>>>> + // Replace all uses of div instruction with quotient phi > node > > >>>>>>>>>>> + J->replaceAllUsesWith(Value.first); > > >>>>>>>>>>> + } else { > > >>>>>>>>>>> + // Replace all uses of rem instruction with remainder > > >>>>>>>>>>> + phi > > node > > >>>>>>>>>>> + J->replaceAllUsesWith(Value.second); > > >>>>>>>>>>> + } > > >>>>>>>>>>> > > >>>>>>>>>>> Looks like there's a missing check for UseSignedOp here. > > >>>>>>>>>>> > > >>>>>>>>>>> The patch doesn't appear to include any testcases. > > >>>>>>>>>>> > > >>>>>>>>>>> -Eli > > >>>>>>>>>> > >>>>>>>>> > > >>> svn.patch>_______________________________________________ > > >>>>>>>>>> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: BypassSlowDiv5-svn.patch Type: application/octet-stream Size: 21120 bytes Desc: BypassSlowDiv5-svn.patch Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/16ae2620/attachment-0001.obj From rafael.espindola at gmail.com Mon Aug 13 09:45:16 2012 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 13 Aug 2012 10:45:16 -0400 Subject: [llvm-commits] patch to llvm-link to link in archives In-Reply-To: <50289241.9020600@tut.fi> References: <5024D584.90305@nokia.com> <50289241.9020600@tut.fi> Message-ID: > Is there other portable solution that permits these cases nicely and *on > all platforms*? Or, looking from the another aspect: is it really so much > code > to maintain that one benefits much from removal given there are users for > that > feature? I think the main reason for the removal of llvm-ld (and why I don't think it is a good idea to extend llvm-link) is that they were never designed to be a full feature linker. At first impression it looks like it works, but then there is always one more fix that is needed. The way forward in this are is lld IMHO. It is being designed to be a real linker replacement and to work on all 3 major platforms. > -- > Pekka Cheers, Rafael From nrotem at apple.com Mon Aug 13 10:29:53 2012 From: nrotem at apple.com (Nadav Rotem) Date: Mon, 13 Aug 2012 15:29:53 -0000 Subject: [llvm-commits] [llvm] r161758 - /llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Message-ID: <20120813152953.95A2E352404C@llvm.org> Author: nadav Date: Mon Aug 13 10:29:53 2012 New Revision: 161758 URL: http://llvm.org/viewvc/llvm-project?rev=161758&view=rev Log: Fix a documentation typo. Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Modified: llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h?rev=161758&r1=161757&r2=161758&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h (original) +++ llvm/trunk/include/llvm/Analysis/MemoryDependenceAnalysis.h Mon Aug 13 10:29:53 2012 @@ -124,11 +124,11 @@ } /// isClobber - Return true if this MemDepResult represents a query that is - /// a instruction clobber dependency. + /// an instruction clobber dependency. bool isClobber() const { return Value.getInt() == Clobber; } /// isDef - Return true if this MemDepResult represents a query that is - /// a instruction definition dependency. + /// an instruction definition dependency. bool isDef() const { return Value.getInt() == Def; } /// isNonLocal - Return true if this MemDepResult represents a query that From pranavb at codeaurora.org Mon Aug 13 11:08:53 2012 From: pranavb at codeaurora.org (Pranav Bhandarkar) Date: Mon, 13 Aug 2012 11:08:53 -0500 Subject: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary saves and restores to and from the stack in leaf functions. In-Reply-To: <4d84d4a6aebedd6d273e3ace50d3f43c.squirrel@www.codeaurora.org> References: <016d01cd7748$4aacc640$e00652c0$@codeaurora.org> <4d84d4a6aebedd6d273e3ace50d3f43c.squirrel@www.codeaurora.org> Message-ID: <007701cd796d$efa7a530$cef6ef90$@codeaurora.org> Can somebody with rights to review/approve a Hexagon backend patch please review it, so that persons with commit-after-approval rights to the Hexagon backend can commit it. Thanks, Pranav > -----Original Message----- > From: Arnold Schwaighofer [mailto:arnolds at codeaurora.org] > Sent: Friday, August 10, 2012 6:25 PM > To: Pranav Bhandarkar > Cc: llvm-commits at cs.uiuc.edu > Subject: Re: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary saves > and restores to and from the stack in leaf functions. > > LGTM. > > > > Hi, > > > > This is a fix for PR-13572 (http://llvm.org/bugs/show_bug.cgi?id=13572). > > > > HexagonInstrInfo.td wrongly encoded that register pairs D0 through > > D10, R22, R23, R28, R31 and the predicate registers were clobbered by > > a tail call instruction. So if a function turned into a leaf function > > on account of a call being converted into a tail call (jump), the > > caller-save registers would still get saved on the stack and restored > > from it, quite unnecessarily. > > > > The attached patch fixes this problem. I have tested that it builds > > and installs and have also run make check without any regressions with > > this patch. > > > > Pranav > > > > Qualcomm Innovation Center (QuIC) is a member of the Code Aurora > Forum. > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum. From mren at apple.com Mon Aug 13 12:26:46 2012 From: mren at apple.com (Manman Ren) Date: Mon, 13 Aug 2012 17:26:46 -0000 Subject: [llvm-commits] [llvm] r161763 - /llvm/trunk/lib/Target/X86/X86Subtarget.cpp Message-ID: <20120813172646.DC2FD352404C@llvm.org> Author: mren Date: Mon Aug 13 12:26:46 2012 New Revision: 161763 URL: http://llvm.org/viewvc/llvm-project?rev=161763&view=rev Log: X86: when auto-detecting the subtarget features, make sure use IsIntel to detect Nehalem, Westmere and Sandy Bridge. AMD also has processor family 6. Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=161763&r1=161762&r2=161763&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original) +++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Mon Aug 13 12:26:46 2012 @@ -248,9 +248,9 @@ // If it's Nehalem, unaligned memory access is fast. // Include Westmere and Sandy Bridge as well. // FIXME: add later processors. - if ((Family == 6 && Model == 26) || + if (IsIntel && ((Family == 6 && Model == 26) || (Family == 6 && Model == 44) || - (Family == 6 && Model == 42)) { + (Family == 6 && Model == 42))) { IsUAMemFast = true; ToggleFeature(X86::FeatureFastUAMem); } From dblaikie at gmail.com Mon Aug 13 12:50:44 2012 From: dblaikie at gmail.com (David Blaikie) Date: Mon, 13 Aug 2012 17:50:44 -0000 Subject: [llvm-commits] [llvm] r161765 - /llvm/trunk/tools/ Message-ID: <20120813175044.A4AAE352404C@llvm.org> Author: dblaikie Date: Mon Aug 13 12:50:44 2012 New Revision: 161765 URL: http://llvm.org/viewvc/llvm-project?rev=161765&view=rev Log: Ignore known externally-homed tools. Modified: llvm/trunk/tools/ (props changed) Propchange: llvm/trunk/tools/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Aug 13 12:50:44 2012 @@ -0,0 +1,3 @@ +clang +lld +lldb From echristo at apple.com Mon Aug 13 13:18:52 2012 From: echristo at apple.com (Eric Christopher) Date: Mon, 13 Aug 2012 18:18:52 -0000 Subject: [llvm-commits] [llvm] r161768 - in /llvm/trunk: lib/Target/ARM/ARMAsmPrinter.cpp test/CodeGen/ARM/arm-modifier.ll Message-ID: <20120813181852.81EC6352404C@llvm.org> Author: echristo Date: Mon Aug 13 13:18:52 2012 New Revision: 161768 URL: http://llvm.org/viewvc/llvm-project?rev=161768&view=rev Log: Add support for the %H output modifier. Patch by Weiming Zhao. Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp llvm/trunk/test/CodeGen/ARM/arm-modifier.ll Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=161768&r1=161767&r2=161768&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Mon Aug 13 13:18:52 2012 @@ -529,10 +529,23 @@ return false; } - // These modifiers are not yet supported. + // This modifier is not yet supported. case 'h': // A range of VFP/NEON registers suitable for VLD1/VST1. - case 'H': // The highest-numbered register of a pair. return true; + case 'H': // The highest-numbered register of a pair. + const MachineOperand &MO = MI->getOperand(OpNum); + if (!MO.isReg()) + return true; + const TargetRegisterClass &RC = ARM::GPRRegClass; + const MachineFunction &MF = *MI->getParent()->getParent(); + const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo(); + + unsigned RegIdx = TRI->getEncodingValue(MO.getReg()); + RegIdx |= 1; //The odd register is also the higher-numbered one of a pair. + + unsigned Reg = RC.getRegister(RegIdx); + O << ARMInstPrinter::getRegisterName(Reg); + return false; } } Modified: llvm/trunk/test/CodeGen/ARM/arm-modifier.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/arm-modifier.ll?rev=161768&r1=161767&r2=161768&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/arm-modifier.ll (original) +++ llvm/trunk/test/CodeGen/ARM/arm-modifier.ll Mon Aug 13 13:18:52 2012 @@ -57,3 +57,12 @@ store i64 %1, i64* @f3_var, align 4 ret void } + +define i64 @f4(i64* %val) nounwind { +entry: + ;CHECK: f4 + ;CHECK: ldrexd [[REG1:(r[0-9]?[02468])]], {{r[0-9]?[13579]}}, [r0] + ;CHECK: mov r0, [[REG1]] + %0 = tail call i64 asm sideeffect "ldrexd $0, ${0:H}, [$1]", "=&r,r,*Qo"(i64* %val, i64* %val) nounwind + ret i64 %0 +} From echristo at apple.com Mon Aug 13 13:20:04 2012 From: echristo at apple.com (Eric Christopher) Date: Mon, 13 Aug 2012 11:20:04 -0700 Subject: [llvm-commits] Patch for Bug 13556: ARM AsmPrinter doesn't support %H modifier in inline ASM In-Reply-To: <000f01cd7755$508f8180$f1ae8480$@codeaurora.org> References: <000001cd75ba$8e595b40$ab0c11c0$@codeaurora.org> <000901cd768c$1d3a9550$57afbff0$@codeaurora.org> <37CBC81C-AEBB-41B1-BD3D-E5B4AF8AAE3D@apple.com> <000f01cd7755$508f8180$f1ae8480$@codeaurora.org> Message-ID: <21F214C5-B483-4145-8754-CB40DE644F68@apple.com> Committed thusly; M lib/Target/ARM/ARMAsmPrinter.cpp M test/CodeGen/ARM/arm-modifier.ll Committed r161768 Sorry for the delay. -eric On Aug 10, 2012, at 5:07 PM, Weiming Zhao wrote: > Hi Eric, > > Thanks for your reviewing! > > I'm attaching a updated patch. > Feel free to let me know if there is anything wrong. > > Thanks, > Weiming > > > -----Original Message----- > From: Eric Christopher [mailto:echristo at apple.com] > Sent: Friday, August 10, 2012 2:08 PM > To: Weiming Zhao > Cc: 'Jim Grosbach'; llvm-commits at cs.uiuc.edu > Subject: Re: [llvm-commits] Patch for Bug 13556: ARM AsmPrinter doesn't > support %H modifier in inline ASM > > Actually take a look at the patch I put in yesterday that removes that code > :) > > You can then do something, I think, that looks like this: > > (RC is your regclass, RI is the register info) > > unsigned Reg = RC->getRegister(RI->getEncodingValue(MO.getReg())); > unsigned RegToPrint = // check for even/odd here O << > ARMInstPrinter::getRegisterName(RegToPrint); > > Also from first glance it looks like the indenting was a little off starting > where you were checking the regclass and there's no need for the \09s in the > testcase. > > -eric > > On Aug 9, 2012, at 5:07 PM, Weiming Zhao wrote: > >> Hi Jim, >> >> Thanks for your reviewing. >> I agree with your concern. >> A new patch is attached, where I use ARMGPR register class to map the > register number. I assume that, in the td file, the order of registers in > GPR class is consistent with the encoding order. >> >> Thanks, >> Weiming >> >> From: Jim Grosbach [mailto:grosbach at apple.com] >> Sent: Wednesday, August 08, 2012 4:23 PM >> To: Weiming Zhao >> Cc: llvm-commits at cs.uiuc.edu >> Subject: Re: [llvm-commits] Patch for Bug 13556: ARM AsmPrinter >> doesn't support %H modifier in inline ASM >> >> Hi Weiming, >> >> The ordering of the register enum values does not map directly to the > encoding values. >> >> Specifically, the following is fragile and even it it works OK now, it's > making unsafe assumptions about the underlying enum value that may break in > the future: >> + Reg = (Reg - ARM::R0) & 1 ? Reg : Reg + 1; >> + O << ARMInstPrinter::getRegisterName(Reg); >> >> -Jim >> >> On Aug 8, 2012, at 4:07 PM, Weiming Zhao wrote: >> >> >> Hi, >> >> I'm attaching a patch to fix bug 13556: >> http://llvm.org/bugs/show_bug.cgi?id=13556 >> >> In ARM inline AMM, %H represents the highest-numbered register of a pair. >> Routines like atomic read of 64-bit values needs this modifier. >> Currently, ARMAsmPrinter doesn't support this modifier. >> >> The patch fixes this issue. >> Please feel free to review it. >> >> Thanks, >> Weiming >> <0001-Support-H-modifier-for-ARM-inline-ASM.patch>____________________ >> ___________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> <0001-Support-H-modifier-for-ARM-inline-ASM.patch>____________________ >> ___________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > <0001-Support-H-modifier-for-ARM-inline-ASM.patch> From mren at apple.com Mon Aug 13 13:29:42 2012 From: mren at apple.com (Manman Ren) Date: Mon, 13 Aug 2012 18:29:42 -0000 Subject: [llvm-commits] [llvm] r161769 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/vec_ss_load_fold.ll Message-ID: <20120813182942.30BA6352404C@llvm.org> Author: mren Date: Mon Aug 13 13:29:41 2012 New Revision: 161769 URL: http://llvm.org/viewvc/llvm-project?rev=161769&view=rev Log: X86: move Int_CVTSD2SSrr, Int_CVTSI2SSrr, Int_CVTSI2SDrr, Int_CVTSS2SDrr from OpTbl1 to OpTbl2 since they have 3 operands and the last operand can be changed to a memory operand. PR13576 Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=161769&r1=161768&r2=161769&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Aug 13 13:29:41 2012 @@ -414,12 +414,6 @@ { X86::CVTSD2SIrr, X86::CVTSD2SIrm, 0 }, { X86::CVTSS2SI64rr, X86::CVTSS2SI64rm, 0 }, { X86::CVTSS2SIrr, X86::CVTSS2SIrm, 0 }, - { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm, 0 }, - { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm, 0 }, - { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm, 0 }, - { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm, 0 }, - { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm, 0 }, - { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm, 0 }, { X86::CVTTPD2DQrr, X86::CVTTPD2DQrm, TB_ALIGN_16 }, { X86::CVTTPS2DQrr, X86::CVTTPS2DQrm, TB_ALIGN_16 }, { X86::Int_CVTTSD2SI64rr,X86::Int_CVTTSD2SI64rm, 0 }, @@ -680,6 +674,12 @@ { X86::IMUL64rr, X86::IMUL64rm, 0 }, { X86::Int_CMPSDrr, X86::Int_CMPSDrm, 0 }, { X86::Int_CMPSSrr, X86::Int_CMPSSrm, 0 }, + { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm, 0 }, + { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm, 0 }, + { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm, 0 }, + { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm, 0 }, + { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm, 0 }, + { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm, 0 }, { X86::MAXPDrr, X86::MAXPDrm, TB_ALIGN_16 }, { X86::MAXPDrr_Int, X86::MAXPDrm_Int, TB_ALIGN_16 }, { X86::MAXPSrr, X86::MAXPSrm, TB_ALIGN_16 }, Modified: llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll?rev=161769&r1=161768&r2=161769&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Mon Aug 13 13:29:41 2012 @@ -70,3 +70,17 @@ ; CHECK: call ; CHECK: roundss $4, %xmm{{.*}}, %xmm0 } + +; PR13576 +define <2 x double> @test5() nounwind uwtable readnone noinline { +entry: + %0 = tail call <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double> , i32 128) nounwind readnone + ret <2 x double> %0 +; CHECK: test5: +; CHECK: movl +; CHECK: mov +; CHECK: cvtsi2sd +} + +declare <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double>, i32) nounwind readnone From mren at apple.com Mon Aug 13 13:32:59 2012 From: mren at apple.com (Manman Ren) Date: Mon, 13 Aug 2012 11:32:59 -0700 Subject: [llvm-commits] [llvm] r161152 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/PeepholeOptimizer.cpp lib/Target/X86/X86InstrInfo.cpp lib/Target/X86/X86InstrInfo.h test/CodeGen/X86/2012-05-19-avx2-store.ll test/CodeGen/X86/break In-Reply-To: References: Message-ID: <9A7EABF6-3FBE-46E9-B430-FA379D6E2B5A@apple.com> Fixed in r161769. Thanks, Manman On Aug 10, 2012, at 5:11 PM, Rafael Esp?ndola wrote: > On 10 August 2012 19:54, Manman Ren wrote: >> >> Thank you. > > It is pr13576 now. It reduces to a really small IL testcase that crashes llc. > >> Manman >> > > Cheers, > Rafael From arnolds at codeaurora.org Mon Aug 13 13:37:46 2012 From: arnolds at codeaurora.org (Arnold Schwaighofer) Date: Mon, 13 Aug 2012 13:37:46 -0500 Subject: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary saves and restores to and from the stack in leaf functions. In-Reply-To: <007701cd796d$efa7a530$cef6ef90$@codeaurora.org> References: <016d01cd7748$4aacc640$e00652c0$@codeaurora.org> <4d84d4a6aebedd6d273e3ace50d3f43c.squirrel@www.codeaurora.org> <007701cd796d$efa7a530$cef6ef90$@codeaurora.org> Message-ID: <5029497A.5000203@codeaurora.org> I'll commit it for you. On 8/13/2012 11:08 AM, Pranav Bhandarkar wrote: > Can somebody with rights to review/approve a Hexagon backend patch please > review it, so that persons with commit-after-approval rights to the Hexagon > backend can commit it. > > Thanks, > Pranav > >> -----Original Message----- >> From: Arnold Schwaighofer [mailto:arnolds at codeaurora.org] >> Sent: Friday, August 10, 2012 6:25 PM >> To: Pranav Bhandarkar >> Cc: llvm-commits at cs.uiuc.edu >> Subject: Re: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary saves >> and restores to and from the stack in leaf functions. >> >> LGTM. >> >> >>> Hi, >>> >>> This is a fix for PR-13572 (http://llvm.org/bugs/show_bug.cgi?id=13572). >>> >>> HexagonInstrInfo.td wrongly encoded that register pairs D0 through >>> D10, R22, R23, R28, R31 and the predicate registers were clobbered by >>> a tail call instruction. So if a function turned into a leaf function >>> on account of a call being converted into a tail call (jump), the >>> caller-save registers would still get saved on the stack and restored >>> from it, quite unnecessarily. >>> >>> The attached patch fixes this problem. I have tested that it builds >>> and installs and have also run make check without any regressions with >>> this patch. >>> >>> Pranav >>> >>> Qualcomm Innovation Center (QuIC) is a member of the Code Aurora >> Forum. >>> _______________________________________________ >>> llvm-commits mailing list >>> llvm-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >> >> >> -- >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum. > > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum. From pranavb at codeaurora.org Mon Aug 13 13:43:19 2012 From: pranavb at codeaurora.org (Pranav Bhandarkar) Date: Mon, 13 Aug 2012 13:43:19 -0500 Subject: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary saves and restores to and from the stack in leaf functions. In-Reply-To: <5029497A.5000203@codeaurora.org> References: <016d01cd7748$4aacc640$e00652c0$@codeaurora.org> <4d84d4a6aebedd6d273e3ace50d3f43c.squirrel@www.codeaurora.org> <007701cd796d$efa7a530$cef6ef90$@codeaurora.org> <5029497A.5000203@codeaurora.org> Message-ID: <00ae01cd7983$828cbab0$87a63010$@codeaurora.org> Thanks. Pranav > -----Original Message----- > From: Arnold Schwaighofer [mailto:arnolds at codeaurora.org] > Sent: Monday, August 13, 2012 1:38 PM > To: Pranav Bhandarkar > Cc: llvm-commits at cs.uiuc.edu > Subject: Re: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary saves > and restores to and from the stack in leaf functions. > > I'll commit it for you. > > On 8/13/2012 11:08 AM, Pranav Bhandarkar wrote: > > Can somebody with rights to review/approve a Hexagon backend patch > > please review it, so that persons with commit-after-approval rights to > > the Hexagon backend can commit it. > > > > Thanks, > > Pranav > > > >> -----Original Message----- > >> From: Arnold Schwaighofer [mailto:arnolds at codeaurora.org] > >> Sent: Friday, August 10, 2012 6:25 PM > >> To: Pranav Bhandarkar > >> Cc: llvm-commits at cs.uiuc.edu > >> Subject: Re: [llvm-commits] [PATCH, Hexagon]: Remove unnecessary > >> saves and restores to and from the stack in leaf functions. > >> > >> LGTM. > >> > >> > >>> Hi, > >>> > >>> This is a fix for PR-13572 (http://llvm.org/bugs/show_bug.cgi?id=13572). > >>> > >>> HexagonInstrInfo.td wrongly encoded that register pairs D0 through > >>> D10, R22, R23, R28, R31 and the predicate registers were clobbered > >>> by a tail call instruction. So if a function turned into a leaf > >>> function on account of a call being converted into a tail call > >>> (jump), the caller-save registers would still get saved on the stack > >>> and restored from it, quite unnecessarily. > >>> > >>> The attached patch fixes this problem. I have tested that it builds > >>> and installs and have also run make check without any regressions > >>> with this patch. > >>> > >>> Pranav > >>> > >>> Qualcomm Innovation Center (QuIC) is a member of the Code Aurora > >> Forum. > >>> _______________________________________________ > >>> llvm-commits mailing list > >>> llvm-commits at cs.uiuc.edu > >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > >>> > >> > >> > >> -- > >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum. > > > > > > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum. From dvyukov at google.com Mon Aug 13 13:44:44 2012 From: dvyukov at google.com (Dmitry Vyukov) Date: Mon, 13 Aug 2012 18:44:44 -0000 Subject: [llvm-commits] [compiler-rt] r161770 - in /compiler-rt/trunk/lib/tsan/go: buildgo.sh tsan_go.cc Message-ID: <20120813184444.AB679352404C@llvm.org> Author: dvyukov Date: Mon Aug 13 13:44:44 2012 New Revision: 161770 URL: http://llvm.org/viewvc/llvm-project?rev=161770&view=rev Log: tsan: handle larger number of goroutines + fix a memory leak of goroutine descriptors Modified: compiler-rt/trunk/lib/tsan/go/buildgo.sh compiler-rt/trunk/lib/tsan/go/tsan_go.cc Modified: compiler-rt/trunk/lib/tsan/go/buildgo.sh URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/go/buildgo.sh?rev=161770&r1=161769&r2=161770&view=diff ============================================================================== --- compiler-rt/trunk/lib/tsan/go/buildgo.sh (original) +++ compiler-rt/trunk/lib/tsan/go/buildgo.sh Mon Aug 13 13:44:44 2012 @@ -33,7 +33,6 @@ ../../sanitizer_common/sanitizer_libc.cc ../../sanitizer_common/sanitizer_posix.cc ../../sanitizer_common/sanitizer_printf.cc - ../../sanitizer_common/sanitizer_symbolizer.cc " if [ "$LINUX" != "" ]; then @@ -42,10 +41,10 @@ ../../sanitizer_common/sanitizer_linux.cc " elif [ "$MAC" != "" ]; then - SRCS+=" - ../rtl/tsan_platform_mac.cc - ../../sanitizer_common/sanitizer_mac.cc - " + SRCS+=" + ../rtl/tsan_platform_mac.cc + ../../sanitizer_common/sanitizer_mac.cc + " fi SRCS+=$ADD_SRCS Modified: compiler-rt/trunk/lib/tsan/go/tsan_go.cc URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/go/tsan_go.cc?rev=161770&r1=161769&r2=161770&view=diff ============================================================================== --- compiler-rt/trunk/lib/tsan/go/tsan_go.cc (original) +++ compiler-rt/trunk/lib/tsan/go/tsan_go.cc Mon Aug 13 13:44:44 2012 @@ -18,7 +18,9 @@ namespace __tsan { -static ThreadState *goroutines[kMaxTid]; +const int kMaxGoroutinesEver = 128*1024; + +static ThreadState *goroutines[kMaxGoroutinesEver]; void InitializeInterceptors() { } @@ -79,9 +81,14 @@ extern "C" { static void AllocGoroutine(int tid) { - goroutines[tid] = (ThreadState*)internal_alloc(MBlockThreadContex, + if (tid >= kMaxGoroutinesEver) { + Printf("FATAL: Reached goroutine limit\n"); + Die(); + } + ThreadState *thr = (ThreadState*)internal_alloc(MBlockThreadContex, sizeof(ThreadState)); - internal_memset(goroutines[tid], 0, sizeof(ThreadState)); + internal_memset(thr, 0, sizeof(*thr)); + goroutines[tid] = thr; } void __tsan_init() { @@ -152,6 +159,8 @@ thr->in_rtl++; ThreadFinish(thr); thr->in_rtl--; + internal_free(thr); + goroutines[goid] = 0; } void __tsan_acquire(int goid, void *addr) { @@ -159,7 +168,6 @@ thr->in_rtl++; Acquire(thr, 0, (uptr)addr); thr->in_rtl--; - //internal_free(thr); } void __tsan_release(int goid, void *addr) { From dvyukov at google.com Mon Aug 13 13:47:54 2012 From: dvyukov at google.com (Dmitry Vyukov) Date: Mon, 13 Aug 2012 22:47:54 +0400 Subject: [llvm-commits] [compiler-rt] r161045 - in /compiler-rt/trunk/lib/sanitizer_common: CMakeLists.txt sanitizer_symbolizer.cc sanitizer_symbolizer.h sanitizer_symbolizer_llvm.cc In-Reply-To: <20120731115126.ECAFC2A6C071@llvm.org> References: <20120731115126.ECAFC2A6C071@llvm.org> Message-ID: This breaks Go runtime: gcc gotsan.cc -S -o tmp.s -I../rtl -I../.. -I../../sanitizer_common -fPIC -g -Wall -Werror -fno-exceptions -DTSAN_GO -DSANITIZER_GO -DTSAN_SHADOW_COUNT=4 -DTSAN_DEBUG=0 -O3 -fomit-frame-pointer -ffreestanding as gotsan.s -o race_linux_amd64.syso /usr/bin/ld.gold: race_linux_amd64.syso: in function __sanitizer::dl_iterate_phdr_cb(dl_phdr_info*, unsigned long, void*):gotsan.cc:4485: error: undefined reference to '__sanitizer::ModuleDIContext::ModuleDIContext(char const*, unsigned long)' /usr/bin/ld.gold: race_linux_amd64.syso: in function __sanitizer::dl_iterate_phdr_cb(dl_phdr_info*, unsigned long, void*):gotsan.cc:4492: error: undefined reference to '__sanitizer::ModuleDIContext::addAddressRange(unsigned long, unsigned long)' /usr/bin/ld.gold: race_linux_amd64.syso: in function __sanitizer::FindDWARFSection(unsigned long, char const*, __sanitizer::DWARFSection*):gotsan.cc:4442: error: undefined reference to '__sanitizer::IsFullNameOfDWARFSection(char const*, char const*)' collect2: ld returned 1 exit status Please keep everything related to symbolization in separate files as it makes sense only for C/C++. On Tue, Jul 31, 2012 at 3:51 PM, Alexey Samsonov wrote: > Author: samsonov > Date: Tue Jul 31 06:51:26 2012 > New Revision: 161045 > > URL: http://llvm.org/viewvc/llvm-project?rev=161045&view=rev > Log: > [Sanitizer] Wrapper around llvm::DIContext from LLVM DebugInfo library. If > a macro SANITIZER_USES_LLVM_LIBS is defined (by default it is not), then > sanitizer runtime includes llvm headers and tries to use LLVM libs for > in-process symbolization. To make it functional, we have to link with these > LLVM libs - either pass them to linker from Clang driver, or link them into > static ASan runtime when we build it. > > Added: > compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_llvm.cc > Modified: > compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt > compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc > compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h > > Modified: compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt > URL: > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt?rev=161045&r1=161044&r2=161045&view=diff > > ============================================================================== > --- compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt (original) > +++ compiler-rt/trunk/lib/sanitizer_common/CMakeLists.txt Tue Jul 31 > 06:51:26 2012 > @@ -11,13 +11,15 @@ > sanitizer_posix.cc > sanitizer_printf.cc > sanitizer_symbolizer.cc > + sanitizer_symbolizer_llvm.cc > sanitizer_win.cc > ) > > set(SANITIZER_CFLAGS "-fPIC -fno-exceptions -funwind-tables > -fvisibility=hidden") > > set(SANITIZER_COMMON_DEFINITIONS > - SANITIZER_HAS_EXCEPTIONS=1) > + SANITIZER_HAS_EXCEPTIONS=1 > + ) > > if(CAN_TARGET_X86_64) > add_library(RTSanitizerCommon.x86_64 OBJECT ${SANITIZER_SOURCES}) > > Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc > URL: > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc?rev=161045&r1=161044&r2=161045&view=diff > > ============================================================================== > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc > (original) > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc Tue Jul > 31 06:51:26 2012 > @@ -7,13 +7,11 @@ > // > > //===----------------------------------------------------------------------===// > // > -// This is a stub for LLVM-based symbolizer. > // This file is shared between AddressSanitizer and ThreadSanitizer > -// run-time libraries. See sanitizer.h for details. > +// run-time libraries. See sanitizer_symbolizer.h for details. > > //===----------------------------------------------------------------------===// > > #include "sanitizer_common.h" > -#include "sanitizer_placement_new.h" > #include "sanitizer_procmaps.h" > #include "sanitizer_symbolizer.h" > > @@ -50,6 +48,7 @@ > n_ranges_ = 0; > mapped_addr_ = 0; > mapped_size_ = 0; > + dwarf_context_ = 0; > } > > void ModuleDIContext::addAddressRange(uptr beg, uptr end) { > @@ -71,29 +70,25 @@ > info->module = internal_strdup(full_name_); > info->module_offset = info->address - base_address_; > if (mapped_addr_ == 0) > - CreateDIContext(); > - // FIXME: Use the actual debug info context here. > - info->function = 0; > - info->file = 0; > - info->line = 0; > - info->column = 0; > + CreateDWARFContext(); > + getLineInfoFromContext(dwarf_context_, info); > } > > -void ModuleDIContext::CreateDIContext() { > +void ModuleDIContext::CreateDWARFContext() { > mapped_addr_ = (uptr)MapFileToMemory(full_name_, &mapped_size_); > CHECK(mapped_addr_); > DWARFSection debug_info; > DWARFSection debug_abbrev; > - DWARFSection debug_line; > DWARFSection debug_aranges; > + DWARFSection debug_line; > DWARFSection debug_str; > FindDWARFSection(mapped_addr_, "debug_info", &debug_info); > FindDWARFSection(mapped_addr_, "debug_abbrev", &debug_abbrev); > - FindDWARFSection(mapped_addr_, "debug_line", &debug_line); > FindDWARFSection(mapped_addr_, "debug_aranges", &debug_aranges); > + FindDWARFSection(mapped_addr_, "debug_line", &debug_line); > FindDWARFSection(mapped_addr_, "debug_str", &debug_str); > - // FIXME: Construct actual debug info context using mapped_addr, > - // mapped_size and pointers to DWARF sections in memory. > + dwarf_context_ = getDWARFContext(debug_info, debug_abbrev, > debug_aranges, > + debug_line, debug_str); > } > > class Symbolizer { > > Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h > URL: > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h?rev=161045&r1=161044&r2=161045&view=diff > > ============================================================================== > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h > (original) > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h Tue Jul > 31 06:51:26 2012 > @@ -66,6 +66,14 @@ > DWARFSection *section); > bool IsFullNameOfDWARFSection(const char *full_name, const char > *short_name); > > +class DWARFContext; > +DWARFContext *getDWARFContext(DWARFSection debug_info, > + DWARFSection debug_abbrev, > + DWARFSection debug_aranges, > + DWARFSection debug_line, > + DWARFSection debug_str); > +void getLineInfoFromContext(DWARFContext *context, AddressInfo *info); > + > class ModuleDIContext { > public: > ModuleDIContext(const char *module_name, uptr base_address); > @@ -76,7 +84,7 @@ > const char *full_name() const { return full_name_; } > > private: > - void CreateDIContext(); > + void CreateDWARFContext(); > > struct AddressRange { > uptr beg; > @@ -90,6 +98,7 @@ > uptr n_ranges_; > uptr mapped_addr_; > uptr mapped_size_; > + DWARFContext *dwarf_context_; > }; > > // OS-dependent function that gets the linked list of all loaded modules. > > Added: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_llvm.cc > URL: > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_llvm.cc?rev=161045&view=auto > > ============================================================================== > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_llvm.cc > (added) > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_llvm.cc > Tue Jul 31 06:51:26 2012 > @@ -0,0 +1,104 @@ > +//===-- sanitizer_symbolizer_llvm.cc > --------------------------------------===// > +// > +// The LLVM Compiler Infrastructure > +// > +// This file is distributed under the University of Illinois Open Source > +// License. See LICENSE.TXT for details. > +// > > +//===----------------------------------------------------------------------===// > +// > +// This is a wrapper around llvm::DIContext, moved to separate file to > +// include LLVM headers in a single place in sanitizer library. If macro > +// SANITIZER_USES_LLVM_LIBS is not defined, then sanitizer runtime > +// will not include LLVM headers and will not require static > +// LLVM libraries to link with. > +// In this case, the symbolizer will just return zeroes instead of > +// valid file/line info. > +// > +// This file is shared between AddressSanitizer and ThreadSanitizer > +// run-time libraries. > > +//===----------------------------------------------------------------------===// > + > +#include "sanitizer_common.h" > +#include "sanitizer_symbolizer.h" > + > +#ifdef SANITIZER_USES_LLVM_LIBS > +# ifndef __STDC_LIMIT_MACROS > +# define __STDC_LIMIT_MACROS 1 > +# endif > +# ifndef __STDC_CONSTANT_MACROS > +# define __STDC_CONSTANT_MACROS 1 > +# endif > +# include "llvm/ADT/StringRef.h" > +# include "llvm/DebugInfo/DIContext.h" > + > +namespace __sanitizer { > + > +static llvm::StringRef ToStringRef(const DWARFSection §ion) { > + return llvm::StringRef(section.data, section.size); > +} > + > +class DWARFContext : public llvm::DIContext {}; > + > +DWARFContext *getDWARFContext(DWARFSection debug_info, > + DWARFSection debug_abbrev, > + DWARFSection debug_aranges, > + DWARFSection debug_line, > + DWARFSection debug_str) { > + return (DWARFContext*)llvm::DIContext::getDWARFContext( > + true, ToStringRef(debug_info), ToStringRef(debug_abbrev), > + llvm::StringRef(), // don't use .debug_aranges for now. > + ToStringRef(debug_line), ToStringRef(debug_str)); > +} > + > +void getLineInfoFromContext(DWARFContext *context, AddressInfo *info) { > + CHECK(context); > + uint32_t flags = llvm::DILineInfoSpecifier::FileLineInfo | > + llvm::DILineInfoSpecifier::AbsoluteFilePath | > + llvm::DILineInfoSpecifier::FunctionName; > + llvm::DILineInfo line_info = context->getLineInfoForAddress( > + info->module_offset, flags); > + > + const char *function = line_info.getFunctionName(); > + CHECK(function); > + if (0 != internal_strcmp("", function)) > + info->function = internal_strdup(function); > + else > + info->function = 0; > + > + const char *file = line_info.getFileName(); > + CHECK(file); > + if (0 != internal_strcmp("", file)) > + info->file = internal_strdup(file); > + else > + info->file = 0; > + > + info->line = line_info.getLine(); > + info->column = line_info.getColumn(); > +} > + > +} // namespace __sanitizer > + > +#else // SANITIZER_USES_LLVM_LIBS > +namespace __sanitizer { > + > +class DWARFContext {}; > + > +DWARFContext *getDWARFContext(DWARFSection debug_info, > + DWARFSection debug_abbrev, > + DWARFSection debug_aranges, > + DWARFSection debug_line, > + DWARFSection debug_str) { > + return 0; > +} > + > +void getLineInfoFromContext(DWARFContext *context, AddressInfo *info) { > + (void)context; > + info->function = 0; > + info->file = 0; > + info->line = 0; > + info->column = 0; > +} > + > +} // namespace __sanitizer > +#endif // SANITIZER_USES_LLVM_LIBS > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/bc8fe5c5/attachment.html From nrotem at apple.com Mon Aug 13 13:52:44 2012 From: nrotem at apple.com (Nadav Rotem) Date: Mon, 13 Aug 2012 18:52:44 -0000 Subject: [llvm-commits] [llvm] r161775 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp test/CodeGen/ARM/2012-08-13-bfi.ll Message-ID: <20120813185244.94B48352404C@llvm.org> Author: nadav Date: Mon Aug 13 13:52:44 2012 New Revision: 161775 URL: http://llvm.org/viewvc/llvm-project?rev=161775&view=rev Log: Do not optimize (or (and X,Y), Z) into BFI and other sequences if the AND ISDNode has more than one user. rdar://11876519 Added: llvm/trunk/test/CodeGen/ARM/2012-08-13-bfi.ll 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=161775&r1=161774&r2=161775&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Mon Aug 13 13:52:44 2012 @@ -7422,8 +7422,12 @@ return COR; } + + // The code below optimizes (or (and X, Y), Z). + // The AND operand needs to have a single user to make these optimizations + // profitable. SDValue N0 = N->getOperand(0); - if (N0.getOpcode() != ISD::AND) + if (N0.getOpcode() != ISD::AND || !N0.hasOneUse()) return SDValue(); SDValue N1 = N->getOperand(1); Added: llvm/trunk/test/CodeGen/ARM/2012-08-13-bfi.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2012-08-13-bfi.ll?rev=161775&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2012-08-13-bfi.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2012-08-13-bfi.ll Mon Aug 13 13:52:44 2012 @@ -0,0 +1,17 @@ +; RUN: llc -march=thumb -mcpu=cortex-a8 < %s | FileCheck %s + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.8.0" + +; CHECK: foo +; CHECK-NOT: bfi +; CHECK: bx +define i32 @foo(i8 zeroext %i) nounwind uwtable readnone ssp { + %1 = and i8 %i, 15 + %2 = zext i8 %1 to i32 + %3 = icmp ult i8 %1, 10 + %4 = or i32 %2, 48 + %5 = add nsw i32 %2, 55 + %6 = select i1 %3, i32 %4, i32 %5 + ret i32 %6 +} From mren at apple.com Mon Aug 13 14:34:29 2012 From: mren at apple.com (Manman Ren) Date: Mon, 13 Aug 2012 19:34:29 -0000 Subject: [llvm-commits] [llvm] r161777 - /llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Message-ID: <20120813193430.00398352404C@llvm.org> Author: mren Date: Mon Aug 13 14:34:29 2012 New Revision: 161777 URL: http://llvm.org/viewvc/llvm-project?rev=161777&view=rev Log: Fix failure on Atom bot due to r161769 Modified: llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Modified: llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll?rev=161777&r1=161776&r2=161777&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll (original) +++ llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Mon Aug 13 14:34:29 2012 @@ -78,7 +78,7 @@ 4.569870e+02, double 1.233210e+02>, i32 128) nounwind readnone ret <2 x double> %0 ; CHECK: test5: -; CHECK: movl +; CHECK: mov ; CHECK: mov ; CHECK: cvtsi2sd } From arnolds at codeaurora.org Mon Aug 13 14:54:01 2012 From: arnolds at codeaurora.org (Arnold Schwaighofer) Date: Mon, 13 Aug 2012 19:54:01 -0000 Subject: [llvm-commits] [llvm] r161778 - in /llvm/trunk: lib/Target/Hexagon/HexagonInstrInfo.td test/CodeGen/Hexagon/simpletailcall.ll Message-ID: <20120813195401.49A6A352404C@llvm.org> Author: arnolds Date: Mon Aug 13 14:54:01 2012 New Revision: 161778 URL: http://llvm.org/viewvc/llvm-project?rev=161778&view=rev Log: [Hexagon] Don't mark callee saved registers as clobbered by a tail call This was causing unnecessary spills/restores of callee saved registers. Fixes PR13572. Patch by Pranav Bhandarkar! Added: llvm/trunk/test/CodeGen/Hexagon/simpletailcall.ll Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td?rev=161778&r1=161777&r2=161778&view=diff ============================================================================== --- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td (original) +++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td Mon Aug 13 14:54:01 2012 @@ -2580,22 +2580,16 @@ } // Tail Calls. -let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1, - Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, - R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in { +let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1 in { def TCRETURNtg : JInst<(outs), (ins calltarget:$dst), "jump $dst // TAILCALL", []>; } -let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1, - Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, - R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in { +let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1 in { def TCRETURNtext : JInst<(outs), (ins calltarget:$dst), "jump $dst // TAILCALL", []>; } -let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1, - Defs = [D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, - R22, R23, R28, R31, P0, P1, P2, P3, LC0, LC1, SA0, SA1] in { +let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1 in { def TCRETURNR : JInst<(outs), (ins IntRegs:$dst), "jumpr $dst // TAILCALL", []>; } Added: llvm/trunk/test/CodeGen/Hexagon/simpletailcall.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Hexagon/simpletailcall.ll?rev=161778&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/Hexagon/simpletailcall.ll (added) +++ llvm/trunk/test/CodeGen/Hexagon/simpletailcall.ll Mon Aug 13 14:54:01 2012 @@ -0,0 +1,14 @@ +; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s +; CHECK: foo_empty +; CHECK-NOT: allocframe +; CHECK-NOT: memd(r29 +; CHECK: jump bar_empty + +define void @foo_empty(i32 %h) nounwind { +entry: + %add = add nsw i32 %h, 3 + %call = tail call i32 bitcast (i32 (...)* @bar_empty to i32 (i32)*)(i32 %add) nounwind + ret void +} + +declare i32 @bar_empty(...) From michael.liao at intel.com Mon Aug 13 15:25:16 2012 From: michael.liao at intel.com (Michael Liao) Date: Mon, 13 Aug 2012 13:25:16 -0700 Subject: [llvm-commits] [PATCH 2/2] FIx PR12312 In-Reply-To: <1344806900.3443.2.camel@snbox> References: <1343850421.3953.42.camel@snbox> <78F46651-ED91-4E31-94B1-4F60D0D029F6@apple.com> <1344806900.3443.2.camel@snbox> Message-ID: <1344889516.2852.3.camel@snbox> Here is another revision of the 2nd part. The new change fixes an potential issue of stale iterator being used. The new loop BFS traversing OR'd tree is now over index instead of iterator as we may add elements in that loop. Yours - Michael On Sun, 2012-08-12 at 14:28 -0700, Michael Liao wrote: > On Fri, 2012-08-10 at 14:27 -0700, Evan Cheng wrote: > > +static SDValue FlaggedOrCombine(SDValue Or, X86::CondCode &CC, SelectionDAG &DAG, > > + const X86Subtarget *Subtarget) { > > > > > > The current naming convention calls for lower cased first letter. > > The revised patch is attached. I checked the function naming in the 1st > part of patch as well. > > > > > > > + if (VecIn != DAG.getVectorShuffle(VT, DL, VecIn, VecIn, &Mask[0])) > > + return SDValue(); > > > > What is this trying to do? Is it potentially creating a vectorshuffle node and then throwing it away? Please don't do that. > > > > It is checking whether the all vector elements are used in that OR'd > tree. I revised the code to use a bit mask for this purpose and simplify > both this checking and other parts. > > Please review the revised patch attached. > > Yours > - Michael > > > Evan > > > > On Aug 1, 2012, at 12:47 PM, Michael Liao wrote: > > > > > Hi > > > > > > This patch is to fix http://llvm.org/bugs/show_bug.cgi?id=12312, where a > > > special use of i128 needs efficient code generation with PTEST from > > > SSE4.1. > > > > > > To fix this issue, 2 patches are developed. The second part is to > > > recognize that special use, casting from <4 x i32> to i128 followed by a > > > zero (or non-zero) checking. That sequence is lowered into OR > > > (X86ISD::OR at the root) tree with all leaves extracted from that vector > > > because i128 is mapped onto GPR pair. The attached patch adds a > > > X86-specific DAG optimization to recognize this OR'd tree and convert it > > > a PTEST if only the flag value is used from that X86ISD::OR root node. > > > > > > Yours > > > - Michael > > > <0002-add-X86-DAG-optimization-to-recognize-a-pttern-PTEST.patch>_______________________________________________ > > > 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-add-X86-DAG-optimization-to-recognize-a-pttern-PTEST.patch Type: text/x-patch Size: 9849 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/2914c53d/attachment.bin From stoklund at 2pi.dk Mon Aug 13 15:49:04 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 20:49:04 -0000 Subject: [llvm-commits] [llvm] r161781 - in /llvm/trunk: lib/CodeGen/EarlyIfConversion.cpp test/CodeGen/X86/early-ifcvt.ll Message-ID: <20120813204904.9ABE1352404C@llvm.org> Author: stoklund Date: Mon Aug 13 15:49:04 2012 New Revision: 161781 URL: http://llvm.org/viewvc/llvm-project?rev=161781&view=rev Log: Handle extra Tail predecessors in if-conversion. It is still possible to if-convert if the tail block has extra predecessors, but the tail phis must be rewritten instead of being removed. Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp llvm/trunk/test/CodeGen/X86/early-ifcvt.ll Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp?rev=161781&r1=161780&r2=161781&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Mon Aug 13 15:49:04 2012 @@ -140,6 +140,12 @@ /// Find a valid insertion point in Head. bool findInsertionPoint(); + /// Replace PHI instructions in Tail with selects. + void replacePHIInstrs(); + + /// Insert selects and rewrite PHI operands to use them. + void rewritePHIOperands(); + public: /// runOnMachineFunction - Initialize per-function data structures. void runOnMachineFunction(MachineFunction &MF) { @@ -343,11 +349,7 @@ if (Succ0->pred_size() != 1 || Succ0->succ_size() != 1) return false; - // We could support additional Tail predecessors by updating phis instead of - // eliminating them. Let's see an example where it matters first. Tail = Succ0->succ_begin()[0]; - if (Tail->pred_size() != 2) - return false; // This is not a triangle. if (Tail != Succ1) { @@ -437,21 +439,11 @@ return true; } - -/// convertIf - Execute the if conversion after canConvertIf has determined the -/// feasibility. -/// -/// Any basic blocks erased will be added to RemovedBlocks. -/// -void SSAIfConv::convertIf(SmallVectorImpl &RemovedBlocks) { - assert(Head && Tail && TBB && FBB && "Call canConvertIf first."); - - // Move all instructions into Head, except for the terminators. - if (TBB != Tail) - Head->splice(InsertionPoint, TBB, TBB->begin(), TBB->getFirstTerminator()); - if (FBB != Tail) - Head->splice(InsertionPoint, FBB, FBB->begin(), FBB->getFirstTerminator()); - +/// replacePHIInstrs - Completely replace PHI instructions with selects. +/// This is possible when the only Tail predecessors are the if-converted +/// blocks. +void SSAIfConv::replacePHIInstrs() { + assert(Tail->pred_size() == 2 && "Cannot replace PHIs"); MachineBasicBlock::iterator FirstTerm = Head->getFirstTerminator(); assert(FirstTerm != Head->end() && "No terminators"); DebugLoc HeadDL = FirstTerm->getDebugLoc(); @@ -467,6 +459,60 @@ PI.PHI->eraseFromParent(); PI.PHI = 0; } +} + +/// rewritePHIOperands - When there are additional Tail predecessors, insert +/// select instructions in Head and rewrite PHI operands to use the selects. +/// Keep the PHI instructions in Tail to handle the other predecessors. +void SSAIfConv::rewritePHIOperands() { + MachineBasicBlock::iterator FirstTerm = Head->getFirstTerminator(); + assert(FirstTerm != Head->end() && "No terminators"); + DebugLoc HeadDL = FirstTerm->getDebugLoc(); + + // Convert all PHIs to select instructions inserted before FirstTerm. + for (unsigned i = 0, e = PHIs.size(); i != e; ++i) { + PHIInfo &PI = PHIs[i]; + DEBUG(dbgs() << "If-converting " << *PI.PHI); + unsigned PHIDst = PI.PHI->getOperand(0).getReg(); + unsigned DstReg = MRI->createVirtualRegister(MRI->getRegClass(PHIDst)); + TII->insertSelect(*Head, FirstTerm, HeadDL, DstReg, Cond, PI.TReg, PI.FReg); + DEBUG(dbgs() << " --> " << *llvm::prior(FirstTerm)); + + // Rewrite PHI operands TPred -> (DstReg, Head), remove FPred. + for (unsigned i = PI.PHI->getNumOperands(); i != 1; i -= 2) { + MachineBasicBlock *MBB = PI.PHI->getOperand(i-1).getMBB(); + if (MBB == getTPred()) { + PI.PHI->getOperand(i-1).setMBB(Head); + PI.PHI->getOperand(i-2).setReg(DstReg); + } else if (MBB == getFPred()) { + PI.PHI->RemoveOperand(i-1); + PI.PHI->RemoveOperand(i-2); + } + } + DEBUG(dbgs() << " --> " << *PI.PHI); + } +} + +/// convertIf - Execute the if conversion after canConvertIf has determined the +/// feasibility. +/// +/// Any basic blocks erased will be added to RemovedBlocks. +/// +void SSAIfConv::convertIf(SmallVectorImpl &RemovedBlocks) { + assert(Head && Tail && TBB && FBB && "Call canConvertIf first."); + + // Move all instructions into Head, except for the terminators. + if (TBB != Tail) + Head->splice(InsertionPoint, TBB, TBB->begin(), TBB->getFirstTerminator()); + if (FBB != Tail) + Head->splice(InsertionPoint, FBB, FBB->begin(), FBB->getFirstTerminator()); + + // Are there extra Tail predecessors? + bool ExtraPreds = Tail->pred_size() != 2; + if (ExtraPreds) + rewritePHIOperands(); + else + replacePHIInstrs(); // Fix up the CFG, temporarily leave Head without any successors. Head->removeSuccessor(TBB); @@ -478,6 +524,7 @@ // Fix up Head's terminators. // It should become a single branch or a fallthrough. + DebugLoc HeadDL = Head->getFirstTerminator()->getDebugLoc(); TII->RemoveBranch(*Head); // Erase the now empty conditional blocks. It is likely that Head can fall @@ -492,7 +539,7 @@ } assert(Head->succ_empty() && "Additional head successors?"); - if (Head->isLayoutSuccessor(Tail)) { + if (!ExtraPreds && Head->isLayoutSuccessor(Tail)) { // Splice Tail onto the end of Head. DEBUG(dbgs() << "Joining tail BB#" << Tail->getNumber() << " into head BB#" << Head->getNumber() << '\n'); Modified: llvm/trunk/test/CodeGen/X86/early-ifcvt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/early-ifcvt.ll?rev=161781&r1=161780&r2=161781&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/early-ifcvt.ll (original) +++ llvm/trunk/test/CodeGen/X86/early-ifcvt.ll Mon Aug 13 15:49:04 2012 @@ -37,3 +37,33 @@ %sub = sub nsw i32 %max.1, %min.1 ret i32 %sub } + +; CHECK: multipreds +; Deal with alternative tail predecessors +; CHECK-NOT: LBB +; CHECK: cmov +; CHECK-NOT: LBB +; CHECK: cmov +; CHECK-NOT: LBB +; CHECK: fprintf + +define void @multipreds(i32 %sw) nounwind uwtable ssp { +entry: + switch i32 %sw, label %if.then29 [ + i32 0, label %if.then37 + i32 127, label %if.end41 + ] + +if.then29: + br label %if.end41 + +if.then37: + br label %if.end41 + +if.end41: + %exit_status.0 = phi i32 [ 2, %if.then29 ], [ 0, %if.then37 ], [ 66, %entry ] + call void (...)* @fprintf(i32 %exit_status.0) nounwind + unreachable +} + +declare void @fprintf(...) nounwind From stoklund at 2pi.dk Mon Aug 13 16:03:25 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 21:03:25 -0000 Subject: [llvm-commits] [llvm] r161782 - /llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Message-ID: <20120813210325.D2D1E352404C@llvm.org> Author: stoklund Date: Mon Aug 13 16:03:25 2012 New Revision: 161782 URL: http://llvm.org/viewvc/llvm-project?rev=161782&view=rev Log: Delete dead typedef. Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp?rev=161782&r1=161781&r2=161782&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Mon Aug 13 16:03:25 2012 @@ -50,8 +50,6 @@ static cl::opt Stress("stress-early-ifcvt", cl::Hidden, cl::desc("Turn all knobs to 11")); -typedef SmallSetVector BlockSetVector; - //===----------------------------------------------------------------------===// // SSAIfConv //===----------------------------------------------------------------------===// From stoklund at 2pi.dk Mon Aug 13 16:03:27 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 21:03:27 -0000 Subject: [llvm-commits] [llvm] r161783 - /llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Message-ID: <20120813210327.D3B21352404D@llvm.org> Author: stoklund Date: Mon Aug 13 16:03:27 2012 New Revision: 161783 URL: http://llvm.org/viewvc/llvm-project?rev=161783&view=rev Log: Count triangles and diamonds in early if-conversion. Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Modified: llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp?rev=161783&r1=161782&r2=161783&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/EarlyIfConversion.cpp Mon Aug 13 16:03:27 2012 @@ -24,6 +24,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SparseSet.h" +#include "llvm/ADT/Statistic.h" #include "llvm/CodeGen/MachineBranchProbabilityInfo.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" @@ -50,6 +51,11 @@ static cl::opt Stress("stress-early-ifcvt", cl::Hidden, cl::desc("Turn all knobs to 11")); +STATISTIC(NumDiamondsSeen, "Number of diamonds"); +STATISTIC(NumDiamondsConv, "Number of diamonds converted"); +STATISTIC(NumTrianglesSeen, "Number of triangles"); +STATISTIC(NumTrianglesConv, "Number of triangles converted"); + //===----------------------------------------------------------------------===// // SSAIfConv //===----------------------------------------------------------------------===// @@ -434,6 +440,10 @@ if (!findInsertionPoint()) return false; + if (isTriangle()) + ++NumTrianglesSeen; + else + ++NumDiamondsSeen; return true; } @@ -499,6 +509,12 @@ void SSAIfConv::convertIf(SmallVectorImpl &RemovedBlocks) { assert(Head && Tail && TBB && FBB && "Call canConvertIf first."); + // Update statistics. + if (isTriangle()) + ++NumTrianglesConv; + else + ++NumDiamondsConv; + // Move all instructions into Head, except for the terminators. if (TBB != Tail) Head->splice(InsertionPoint, TBB, TBB->begin(), TBB->getFirstTerminator()); From michael.liao at intel.com Mon Aug 13 16:15:22 2012 From: michael.liao at intel.com (Michael Liao) Date: Mon, 13 Aug 2012 14:15:22 -0700 Subject: [llvm-commits] [PATCH] Fix PR11334 In-Reply-To: <1343938565.2833.20.camel@snbox> References: <1343165296.3005.10.camel@snbox> <7DE70FDACDE4CD4887C4278C12A2E3050686A8D8@HASMSX104.ger.corp.intel.com> <1343247430.2705.15.camel@snbox> <7DE70FDACDE4CD4887C4278C12A2E3050686A929@HASMSX104.ger.corp.intel.com> <1343248191.2705.22.camel@snbox> <1343248300.2705.23.camel@snbox> <1343689273.2993.22.camel@snbox> <1343938565.2833.20.camel@snbox> Message-ID: <1344892522.2852.7.camel@snbox> Hi Here is the revised patch fixing PR11334. The new patch adds a target-specific BUILD_VECTOR lowering to recover original vector FP extending instead of DAG combining to reduce the overhead of DAG combination. Yours - Michael On Thu, 2012-08-02 at 13:16 -0700, Michael Liao wrote: > Hi > > Just ping again for code review and suggestions. > > Yours > - Michael > > On Mon, 2012-07-30 at 16:01 -0700, Michael Liao wrote: > > Hi > > > > Please find the revised patch attached. Changes includes > > > > + a minor fix to quit if a non-constant index is found in > > extract-vector-elt node > > + rebase the code to the current trunk code > > > > The reason why I choose to recover the scalarized FP_EXTEND back instead > > of do a pre-type-legalization transformation directly from FP_EXTEND to > > X86ISD::VFPEXT is to leverage the existing target-independent DAG > > optimization as much as possible till FP_EXTEND is scalaried into > > BUILD_VECTOR. Even though it makes the code a little complicated > > (recognizing FP_EXTEND pattern from the BUILD_VECTOR and series of > > scalarized EXTRACT_VEC_ELTs), it won't break the optimization like > > (fp_round (fp_extend x)) -> x and etc. It also supports extending v4f32 > > -> v4f64 better as well as from v3f32 to v3f64. > > > > Please commit if it looks OK. > > > > Thanks > > - Michael > > > > > > On Wed, 2012-07-25 at 13:31 -0700, Michael Liao wrote: > > > Typo > > > > > > On Wed, 2012-07-25 at 13:29 -0700, Michael Liao wrote: > > > > On Wed, 2012-07-25 at 13:24 -0700, Rotem, Nadav wrote: > > > > > >>In fact, the real root cause from my understanding is that ISD::FP_EXTEND (including others as well) has the constraint that the input and output vectors must have matching >>element numbers. 'v2f32' is not legal on x86 and there is way to construct a legal FP_EXTEND from > > > > > >>v2f32 to v2f64. This lead to the scalarization of FP_EXTEND during type legalization. The added optimization is to recover it back and re-construct that extending using a target->>specific without that constrain. > > > > > > > > > > Yes. But you don?t need to reconstruct the vector, if you can handle it before it gets scalarized. All you have to do is transform the FP_EXTEND node to your own X86ISD node. > > > > > The inputs to your ISD nodes would be v4f32, and the output would be v2f64. > > > > > > > > The optimization is only targeted to optimize the case for FP_EXTEND. In > > > > > > is not only target to optimize this bug. > > > > > > > case of a user code constructs the similar pattern, it would be > > > > optimized as well. Note the extra shuffle node in the patch, if pattern > > > > constructed including non-identify shuffle (by constructing a series of > > > > extract elements), it could be optimized as well to construct a shuffle > > > > followed by a conversion. > > > > > > > > > > > > > > >> For <3 x float>, it will be legailized (widened) into v4f32. The test included verified that. > > > > > > > > > > Right, the question is, how important is it to support this type ? Because, if we handle FP_EXTEND before type-legalization, then it would be a bit more difficult to handle this type. > > > > > > > > > > > > > <3 x float> is solved as by-product. The main case is to fix <2 x > > > > float>. If the user code uses <2 x double> for most cases but only > > > > several places need converting from float. It's better to use <2 x > > > > float> for that values. > > > > > > > > Yours > > > > - Michael > > > > > > > > _______________________________________________ > > > > 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 > > > _______________________________________________ > 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: 0001-fix-PR11334.patch Type: text/x-patch Size: 8979 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/959be2e6/attachment.bin From isanbard at gmail.com Mon Aug 13 16:20:43 2012 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 13 Aug 2012 21:20:43 -0000 Subject: [llvm-commits] [llvm] r161788 - /llvm/trunk/lib/CodeGen/StackProtector.cpp Message-ID: <20120813212043.74994352404C@llvm.org> Author: void Date: Mon Aug 13 16:20:43 2012 New Revision: 161788 URL: http://llvm.org/viewvc/llvm-project?rev=161788&view=rev Log: Whitespace cleanup. Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=161788&r1=161787&r2=161788&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/StackProtector.cpp (original) +++ llvm/trunk/lib/CodeGen/StackProtector.cpp Mon Aug 13 16:20:43 2012 @@ -47,7 +47,7 @@ Function *F; Module *M; - DominatorTree* DT; + DominatorTree *DT; /// InsertStackProtectors - Insert code into the prologue and epilogue of /// the function. @@ -71,8 +71,8 @@ } StackProtector(const TargetLowering *tli) : FunctionPass(ID), TLI(tli) { - initializeStackProtectorPass(*PassRegistry::getPassRegistry()); - } + initializeStackProtectorPass(*PassRegistry::getPassRegistry()); + } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); @@ -96,7 +96,7 @@ DT = getAnalysisIfAvailable(); if (!RequiresStackProtector()) return false; - + return InsertStackProtectors(); } @@ -168,17 +168,17 @@ // StackGuardSlot = alloca i8* // StackGuard = load __stack_chk_guard // call void @llvm.stackprotect.create(StackGuard, StackGuardSlot) - // + // PointerType *PtrTy = Type::getInt8PtrTy(RI->getContext()); unsigned AddressSpace, Offset; if (TLI->getStackCookieLocation(AddressSpace, Offset)) { Constant *OffsetVal = ConstantInt::get(Type::getInt32Ty(RI->getContext()), Offset); - + StackGuardVar = ConstantExpr::getIntToPtr(OffsetVal, PointerType::get(PtrTy, AddressSpace)); } else { - StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); + StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); } BasicBlock &Entry = F->getEntryBlock(); From mren at apple.com Mon Aug 13 16:22:50 2012 From: mren at apple.com (Manman Ren) Date: Mon, 13 Aug 2012 21:22:50 -0000 Subject: [llvm-commits] [llvm] r161789 - /llvm/trunk/lib/Target/ARM/ARMCallingConv.td Message-ID: <20120813212250.B7802352404C@llvm.org> Author: mren Date: Mon Aug 13 16:22:50 2012 New Revision: 161789 URL: http://llvm.org/viewvc/llvm-project?rev=161789&view=rev Log: ARM: enable struct byval for AAPCS-VFP. This change is to be enabled in clang. rdar://9877866 Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=161789&r1=161788&r2=161789&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original) +++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Mon Aug 13 16:22:50 2012 @@ -160,6 +160,9 @@ //===----------------------------------------------------------------------===// def CC_ARM_AAPCS_VFP : CallingConv<[ + // Handles byval parameters. + CCIfByVal>, + // Handle all vector types as either f64 or v2f64. CCIfType<[v1i64, v2i32, v4i16, v8i8, v2f32], CCBitConvertToType>, CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType>, From bigcheesegs at gmail.com Mon Aug 13 16:21:08 2012 From: bigcheesegs at gmail.com (Michael Spencer) Date: Mon, 13 Aug 2012 14:21:08 -0700 Subject: [llvm-commits] [PATCH] Add mapped_file_region for read/write mapped files. In-Reply-To: <7632ED28-671D-47DC-831A-956F4D6FA375@apple.com> References: <7632ED28-671D-47DC-831A-956F4D6FA375@apple.com> Message-ID: On Mon, Aug 6, 2012 at 5:26 PM, Nick Kledzik wrote: > > On Aug 6, 2012, at 3:37 PM, Michael Spencer wrote: >> On Mon, Aug 6, 2012 at 2:58 PM, Nick Kledzik wrote: >>>> + mapped_file_region(const Twine &path, >>>> + mapmode mode, >>>> + uint64_t length, >>>> + uint64_t offset, >>>> + error_code &ec); >>> >>> Something about constructors that also return an error_code sits wrong with me. In the error case, the constructor succeeds but you are left with a half constructed object. >> >> I don't like it either, but the alternatives don't allow RAII. And all >> of them (except exceptions) require checking a value to make sure the >> returned mapped_file_region is valid. > I know, we've had other discussions about this issue. I keep hoping someone will have a clever solution. > >> >>> By having the error_code at the end, you can now no longer use default values for the length and offset parameters. Your test case has to pass 0, 0 for them which is non-obvious what is happening. Since mapping the whole file is common, it would be nice if that case could just be called without the offset and length parameters. >> >> It's easy to just move ec to be the first parameter. > It is nice have return/out parameters at the end... > >> >>> To support unix and Windows which have different state requirements, you had to create another struct (mapstate) to encapsulate that. So now there are two structs to manage. >> >> mapstate is an internal implementation detail. Users don't know >> anything about mapstate. > My point was not about clients. It was that the implementation was complicated by the extra class. > >>> I would think it solve the above three issues and be cleaner to define an abstract base class and use a factory method for creation. Then the unix and Windows implementations have their own subclasses with the ivars they each need, and the factory method (in the .inc file) just calls the constructor on the concrete subclass. The interface in FileSystem.h would just be the abstract interface: >>> >>> class mapped_file_region { >>> public; >>> mapped_file_region() LLVM_EQ_DELETE; >>> mapped_file_region(mapped_file_region&) LLVM_EQ_DELETE; >>> mapped_file_region &operator =(mapped_file_region&) LLVM_EQ_DELETE; >>> >>> static mapped_file_region* make(const Twine &path, mapmode mode, uint64_t length=0, uint64_t offset=0); >>> >>> virtual error_code error() const; >>> virtual mapmode flags() const; >>> virtual uint64_t size() const; >>> virtual char *data() const; >>> }; >> >> I have two issues with this. The first is that mapped_file_region uses >> RAII and move semantics to manage its lifetime, this forces users to >> use delete or wrap it in an OwningPtr. > Yes, the factory method idea precludes a client have a local variable that will automatically be destroyed at the end of the function or object. > > >> The second is that there is no >> reason to have virtual functions when only one implementation can ever >> be used. > I think the more general rule is don't use indirection what unnecessary. But your implementation used indirection by having just one ivar that points to the real ivars. So, both have an indirection. The virtual > methods are just more obvious as indirection. > > The point of the indirection is to hide that the unix and Windows implementation are radically different and require different amounts of state. Maybe we should just push the indirection in the pre-processor. That is, > in FileSystem.h have: > > class mapped_file_region { > ? > void *View; > mapmode Mode; > uint64_t Size; > #if LLVM_ON_WIN32 > int FD; > HANDLE File; > HANDLE FileMapping; > #endif > ? > > So the extra ivars show up when building for Windows but not for unix. Then there is no need for indirection! ok. > >> >> This also still has the problem of partially constructed objects. > Yes, that is why I had a separate error() method to check for failure. > > A variation on this is to have the constructor just assign ivars and not actually try to do the mapping, and thus cannot fail. Instead we add a method: > error_code map(); > which does the mapping and can fail. Still leaves us with partially constructed objects. > I think the import part is that all the methods that operate on the object fire an assertion if called on a "partially constructed" object. I agree. Attached is an updated patch. - Michael Spencer > -Nick > > >> >>> >>>> + int flags = mode == mapped_file_region::readwrite ? MAP_SHARED : MAP_PRIVATE; >>> I also found this hard to parse. How about: >>> >>> int flags = ((mode == mapped_file_region::readwrite) ? MAP_SHARED : MAP_PRIVATE); >> >> ok. >> >>> -Nick >> >> - Michael Spencer >> >>> >>> >>> On Aug 6, 2012, at 2:00 PM, Michael Spencer wrote: >>>> The attached patch adds mapped_file_region based on >>>> boost::iostreams::mapped_file. This is a replacement for >>>> map_file_pages/unmap_file_pages to work properly on Windows. This can >>>> also be used by MemoryBuffer to finally have memory mapped files on >>>> Windows. >>>> >>>> The reason the previous APIs do not work for Windows is that there are >>>> 3 different handles that need to be kept track of to properly unmap a >>>> region. For munmap there is only 1. >>>> >>>> - Michael Spencer >>>> <0001-PathV2-Add-mapped_file_region.-Implementation-for-Wi.patch> >>> > -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-PathV2-Add-mapped_file_region.-Implementation-for-Wi.patch Type: application/octet-stream Size: 18193 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/32521d5c/attachment.obj From aaron at aaronballman.com Mon Aug 13 16:29:31 2012 From: aaron at aaronballman.com (Aaron Ballman) Date: Mon, 13 Aug 2012 17:29:31 -0400 Subject: [llvm-commits] [llvm] r161446 - /llvm/trunk/lib/CodeGen/StackProtector.cpp In-Reply-To: References: <20120807205905.834562A6C073@llvm.org> <10DC7282-B78D-449C-9EDC-DAFF7DBDBCF0@apple.com> Message-ID: I'd like to ping this thread to see if we can get an consensus or not. I'm proposing we allow this feature to be controlled by a flag that's turned on by default for debug builds, even if it's not on Darwin. ~Aaron On Wed, Aug 8, 2012 at 7:46 AM, Aaron Ballman wrote: > On Wed, Aug 8, 2012 at 1:23 AM, Chris Lattner wrote: >> >> On Aug 7, 2012, at 2:20 PM, Aaron Ballman wrote: >> >>> Do we know why gcc does this? I'm all for compatibility, but it seems >>> like it's taking away a fairly nice safety feature so I am hoping >>> there's some more logic here. >> >> The logic here was that char arrays are the most likely to be overflowed (because people use poor functions like strcat on them), so we get the most bang for the performance buck by instrumenting them. Instrumenting other arrays (e.g. float arrays) adds overhead that is less likely to find a bug. > > Performance makes sense as to why it's off by default, but it seems > like this would make a fairly sensible option that could be turned on > in debug mode by default to help catch people who overwrite > non-character arrays. > > ~Aaron From isanbard at gmail.com Mon Aug 13 16:32:42 2012 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 13 Aug 2012 21:32:42 -0000 Subject: [llvm-commits] [llvm] r161792 - in /llvm/trunk/test/CodeGen/X86: stack-protector-linux.ll stack-protector.ll Message-ID: <20120813213242.9E316352404C@llvm.org> Author: void Date: Mon Aug 13 16:32:42 2012 New Revision: 161792 URL: http://llvm.org/viewvc/llvm-project?rev=161792&view=rev Log: Rename test since it's not linux-specific. Added: llvm/trunk/test/CodeGen/X86/stack-protector.ll - copied unchanged from r161779, llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll Removed: llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll Removed: llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll?rev=161791&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll (original) +++ llvm/trunk/test/CodeGen/X86/stack-protector-linux.ll (removed) @@ -1,28 +0,0 @@ -; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | grep %gs: -; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %fs: -; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %gs: -; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_guard" -; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_fail" - -@"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] - -define void @test(i8* %a) nounwind ssp { -entry: - %a_addr = alloca i8* ; [#uses=2] - %buf = alloca [8 x i8] ; <[8 x i8]*> [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - store i8* %a, i8** %a_addr - %buf1 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] - %0 = load i8** %a_addr, align 4 ; [#uses=1] - %1 = call i8* @strcpy(i8* %buf1, i8* %0) nounwind ; [#uses=0] - %buf2 = bitcast [8 x i8]* %buf to i8* ; [#uses=1] - %2 = call i32 (i8*, ...)* @printf(i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i8* %buf2) nounwind ; [#uses=0] - br label %return - -return: ; preds = %entry - ret void -} - -declare i8* @strcpy(i8*, i8*) nounwind - -declare i32 @printf(i8*, ...) nounwind From michael.liao at intel.com Mon Aug 13 16:34:07 2012 From: michael.liao at intel.com (Michael Liao) Date: Mon, 13 Aug 2012 14:34:07 -0700 Subject: [llvm-commits] [PATCH] Fix PR11334 In-Reply-To: <1343938474.2833.19.camel@snbox> References: <1343165296.3005.10.camel@snbox> <7DE70FDACDE4CD4887C4278C12A2E3050686A8D8@HASMSX104.ger.corp.intel.com> <1343247581.2705.17.camel@snbox> <5010E6EB.6090402@free.fr> <1343323641.2748.24.camel@snbox> <370F2DBC-72BF-4F00-836B-6451BF3FB28D@apple.com> <1343790386.31348.13.camel@snbox> <1343938474.2833.19.camel@snbox> Message-ID: <1344893647.2852.9.camel@snbox> Hi Just ping again for any suggestion on this proposal. Yours - Michael On Thu, 2012-08-02 at 13:14 -0700, Michael Liao wrote: > Hi > > Just ping. Do we have any suggestions on this? > > Yours > - Michael > > On Tue, 2012-07-31 at 20:06 -0700, Michael Liao wrote: > > On Fri, 2012-07-27 at 17:18 -0700, Evan Cheng wrote: > > > On Jul 26, 2012, at 10:27 AM, Michael Liao wrote: > > > > > > > On Thu, 2012-07-26 at 08:42 +0200, Duncan Sands wrote: > > > >> Hi Michael, CC'ing Evan and Chris to see if they have any suggestions for > > > >> how best to deal with this issue. > > > >> > > > > [snipped] > > > >> However this scheme doesn't work so well for floating point vectors, since it's > > > >> not that clear to me what > > > >> v2f64 = vector_shuffle v4f32, v4f32<0,1> > > > >> would mean exactly. > > > > > > > > That looks OK. From the perspective to make backend generate the > > > > proper/efficient code, I have no preference which one will be relaxed. > > > > But, the rationale to relax FP_EXTEND is that we could leverage the > > > > existing optimizations in DAG combination or other target-independent > > > > code generate passes (it's also the one of rationales why PR111334 is > > > > fixed by recovering FP_EXTEND back instead of generating new node in > > > > very early stage) without changing the semantic of ISD opcode or adding > > > > new ones. > > > > > > > > Relaxing FP_EXTEND changes that assumption a little bit but my personal > > > > feeling it should be OK. Semantically, it's still what it's. When > > > > input/output vectors are mismatching: > > > > * if input has more elements than output, only the low part are > > > > extended. > > > > * if output has more elements than input (it's most unlikely for > > > > FP_EXTEND), the high part of the output vector is undefined. > > > > > > This is potentially a big change. I'm very weary of it unless there really isn't a better way to achieve the optimization that you are aiming for. I'm probably not the best person to reason about this. Dan, do you have comments? > > > > > > Evan > > > > I did some experimental change to relax ISD::FP_EXTEND and ISD::FP_ROUND > > and refined the logic of how to widen their result/operands. There's no > > more scalarization needed. > > > > I added experimental support in X86 backend as well. So far, 'make > > check-all' passed with all backends turned on with new test cases > > attached as well. > > > > Yours > > - Michael > > > > BTW, to get the current trunk generates better code for FP rounding from > > v2f64 to v2f32, from v4f64 to v4f32, or etc., I did a similar fixing to > > recover the scalarized FP_ROUND back and map onto X86 specific round > > ISD. I will submit patch soon as well as other minor fixes. > > > > > > > > > > > > > > > Unless the optimization really care about the number of vector elements > > > > (assertions are exceptions), most of them just do optimization based on > > > > ISD opcode. > > > > > > > > Yours > > > > - Michael > > > > > > > >> > > > >> So I'm not too short what the best plan is in general. > > > >> > > > >> Ciao, Duncan. > > > >> > > > >> [*] This is the main reason why running the output of the GCC vectorizer through > > > >> llc sometimes produces poor code. The GCC vectorizer only produces operations > > > >> that it knows can be represented well by the target processor, so we should > > > >> never end up scalarizing but we do. > > > >> > > > >>> > > > >>> However, I need more comments and suggestions from community before > > > >>> pushing direction that way. > > > >>> > > > >>> As a short-term solution, this patch only adds a target-specific DAG > > > >>> optimization. > > > >>> > > > >>> Yours > > > >>> - Michael > > > >>> > > > >>> On Wed, 2012-07-25 at 12:58 -0700, Rotem, Nadav wrote: > > > >>>> Hi Michael, > > > >>>> > > > >>>> In your patch you are counting on the type-legalizer to scalarize the FPEXT operation, only to gether it again. I think that the pre-type-legalization DAGCombine code would be short and simple. Why not implement a DAGCombine optimization which works on vector FPEXT ISDs ? I understand that it will be more difficult to handle types such as <3 x float>, but are these really important ? > > > >>>> > > > >>>> Thanks, > > > >>>> Nadav > > > >>>> > > > >>>> -----Original Message----- > > > >>>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Michael Liao > > > >>>> Sent: Wednesday, July 25, 2012 00:28 > > > >>>> To: llvm-commits at cs.uiuc.edu > > > >>>> Subject: [llvm-commits] [PATCH] Fix PR11334 > > > >>>> > > > >>>> Hi > > > >>>> > > > >>>> Please review the attached patch fixing PR11334. With this patch, the test case in PR11334 could generate the expected insn, CVTPS2PD instead of series of CVTSS2SD. An enhanced test case is included as well. > > > >>>> > > > >>>> Yours > > > >>>> - Michael > > > >>> > > > >>> > > > >>> _______________________________________________ > > > >>> 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 > > > > > > > _______________________________________________ > > 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 rafael.espindola at gmail.com Mon Aug 13 16:41:56 2012 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 13 Aug 2012 17:41:56 -0400 Subject: [llvm-commits] [llvm] r161446 - /llvm/trunk/lib/CodeGen/StackProtector.cpp In-Reply-To: References: <20120807205905.834562A6C073@llvm.org> <10DC7282-B78D-449C-9EDC-DAFF7DBDBCF0@apple.com> Message-ID: On 13 August 2012 17:29, Aaron Ballman wrote: > I'd like to ping this thread to see if we can get an consensus or not. > I'm proposing we allow this feature to be controlled by a flag that's > turned on by default for debug builds, even if it's not on Darwin. Probably depends on what you mean by "debug builds". The code generated by the compiler should not depend on * The compiler itself being a debug build or not * The -g flag I am almost sure it is OK to have a -ffull-stack-protector flag. It might also make sense for -O0 -fstack-protector to default to it. > ~Aaron Cheers, Rafael From stoklund at 2pi.dk Mon Aug 13 16:52:57 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 21:52:57 -0000 Subject: [llvm-commits] [llvm] r161794 - in /llvm/trunk: include/llvm/Target/TargetInstrInfo.h lib/CodeGen/TwoAddressInstructionPass.cpp lib/Target/ARM/Thumb2InstrInfo.cpp lib/Target/ARM/Thumb2InstrInfo.h Message-ID: <20120813215257.7B736352404C@llvm.org> Author: stoklund Date: Mon Aug 13 16:52:57 2012 New Revision: 161794 URL: http://llvm.org/viewvc/llvm-project?rev=161794&view=rev Log: Remove the TII::scheduleTwoAddrSource() hook. It never does anything when running 'make check', and it get's in the way of updating live intervals in 2-addr. The hook was originally added to help form IT blocks in Thumb2 code before register allocation, but the pass ordering has changed since then, and we run if-conversion after register allocation now. When the MI scheduler is enabled, there will be no less than two schedulers between 2-addr and Thumb2ITBlockPass, so this hook is unlikely to help anything. Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h Modified: llvm/trunk/include/llvm/Target/TargetInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetInstrInfo.h?rev=161794&r1=161793&r2=161794&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetInstrInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetInstrInfo.h Mon Aug 13 16:52:57 2012 @@ -188,14 +188,6 @@ const MachineInstr *Orig, const TargetRegisterInfo &TRI) const = 0; - /// scheduleTwoAddrSource - Schedule the copy / re-mat of the source of the - /// two-addrss instruction inserted by two-address pass. - virtual void scheduleTwoAddrSource(MachineInstr *SrcMI, - MachineInstr *UseMI, - const TargetRegisterInfo &TRI) const { - // Do nothing. - } - /// duplicate - Create a duplicate of the Orig instruction in MF. This is like /// MachineFunction::CloneMachineInstr(), but the target may update operands /// that are required to be unique. Modified: llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp?rev=161794&r1=161793&r2=161794&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp (original) +++ llvm/trunk/lib/CodeGen/TwoAddressInstructionPass.cpp Mon Aug 13 16:52:57 2012 @@ -1352,17 +1352,6 @@ } } } - - // We didn't change anything if there was a single tied pair, and that - // pair didn't require copies. - if (AllUsesCopied || TiedPairs.size() > 1) { - // Schedule the source copy / remat inserted to form two-address - // instruction. FIXME: Does it matter the distance map may not be - // accurate after it's scheduled? - MachineBasicBlock::iterator PrevMI = MI; - --PrevMI; - TII->scheduleTwoAddrSource(PrevMI, MI, *TRI); - } } /// runOnMachineFunction - Reduce two-address instructions to two operands. Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp?rev=161794&r1=161793&r2=161794&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.cpp Mon Aug 13 16:52:57 2012 @@ -563,48 +563,6 @@ return Offset == 0; } -/// scheduleTwoAddrSource - Schedule the copy / re-mat of the source of the -/// two-addrss instruction inserted by two-address pass. -void -Thumb2InstrInfo::scheduleTwoAddrSource(MachineInstr *SrcMI, - MachineInstr *UseMI, - const TargetRegisterInfo &TRI) const { - if (SrcMI->getOpcode() != ARM::tMOVr || SrcMI->getOperand(1).isKill()) - return; - - unsigned PredReg = 0; - ARMCC::CondCodes CC = getInstrPredicate(UseMI, PredReg); - if (CC == ARMCC::AL || PredReg != ARM::CPSR) - return; - - // Schedule the copy so it doesn't come between previous instructions - // and UseMI which can form an IT block. - unsigned SrcReg = SrcMI->getOperand(1).getReg(); - ARMCC::CondCodes OCC = ARMCC::getOppositeCondition(CC); - MachineBasicBlock *MBB = UseMI->getParent(); - MachineBasicBlock::iterator MBBI = SrcMI; - unsigned NumInsts = 0; - while (--MBBI != MBB->begin()) { - if (MBBI->isDebugValue()) - continue; - - MachineInstr *NMI = &*MBBI; - ARMCC::CondCodes NCC = getInstrPredicate(NMI, PredReg); - if (!(NCC == CC || NCC == OCC) || - NMI->modifiesRegister(SrcReg, &TRI) || - NMI->modifiesRegister(ARM::CPSR, &TRI)) - break; - if (++NumInsts == 4) - // Too many in a row! - return; - } - - if (NumInsts) { - MBB->remove(SrcMI); - MBB->insert(++MBBI, SrcMI); - } -} - ARMCC::CondCodes llvm::getITInstrPredicate(const MachineInstr *MI, unsigned &PredReg) { unsigned Opc = MI->getOpcode(); Modified: llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h?rev=161794&r1=161793&r2=161794&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h (original) +++ llvm/trunk/lib/Target/ARM/Thumb2InstrInfo.h Mon Aug 13 16:52:57 2012 @@ -57,11 +57,6 @@ const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const; - /// scheduleTwoAddrSource - Schedule the copy / re-mat of the source of the - /// two-addrss instruction inserted by two-address pass. - void scheduleTwoAddrSource(MachineInstr *SrcMI, MachineInstr *UseMI, - const TargetRegisterInfo &TRI) const; - /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As /// such, whenever a client has an instance of instruction info, it should /// always be able to get register info as well (through this method). From brad at comstyle.com Mon Aug 13 17:10:19 2012 From: brad at comstyle.com (Brad Smith) Date: Mon, 13 Aug 2012 18:10:19 -0400 Subject: [llvm-commits] [PATCH] Make use of OpenBSD's libc routines for stack protector In-Reply-To: <20120811074915.GL28412@rox.home.comstyle.com> References: <20120809075229.GC28412@rox.home.comstyle.com> <20120811074915.GL28412@rox.home.comstyle.com> Message-ID: <20120813221018.GA19975@rox.home.comstyle.com> On Sat, Aug 11, 2012 at 03:49:15AM -0400, Brad Smith wrote: > On Thu, Aug 09, 2012 at 01:40:14AM -0700, Eli Friedman wrote: > > On Thu, Aug 9, 2012 at 12:52 AM, Brad Smith wrote: > > > This makes LLVM use OpenBSD's libc routines for stack protector. > > > > +#if defined(__OpenBSD__) > > > > This is wrong; you want to check if the target is OpenBSD, not if the > > host is OpenBSD. > > You're right. How about this? Ok, here is the diff with a test addition. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -------------- next part -------------- Index: lib/CodeGen/StackProtector.cpp =================================================================== --- lib/CodeGen/StackProtector.cpp (revision 161795) +++ lib/CodeGen/StackProtector.cpp (working copy) @@ -16,6 +16,7 @@ #define DEBUG_TYPE "stack-protector" #include "llvm/CodeGen/Passes.h" +#include "llvm/ADT/Triple.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Attributes.h" #include "llvm/Constants.h" @@ -178,7 +179,10 @@ StackGuardVar = ConstantExpr::getIntToPtr(OffsetVal, PointerType::get(PtrTy, AddressSpace)); } else { - StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); + if (Triple(TLI->getTargetMachine().getTargetTriple()).getOS() == llvm::Triple::OpenBSD) + StackGuardVar = M->getOrInsertGlobal("__guard", PtrTy); + else + StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy); } BasicBlock &Entry = F->getEntryBlock(); @@ -255,10 +259,24 @@ BasicBlock *StackProtector::CreateFailBB() { BasicBlock *FailBB = BasicBlock::Create(F->getContext(), "CallStackCheckFailBlk", F); - Constant *StackChkFail = - M->getOrInsertFunction("__stack_chk_fail", - Type::getVoidTy(F->getContext()), NULL); - CallInst::Create(StackChkFail, "", FailBB); + if (Triple(TLI->getTargetMachine().getTargetTriple()).getOS() == llvm::Triple::OpenBSD) { + Constant *StackChkFail = + M->getOrInsertFunction("__stack_smash_handler", + Type::getVoidTy(F->getContext()), NULL); + Constant *G = new GlobalVariable(*M, + ArrayType::get(Type::getInt1Ty(F->getContext()), + F->getName().size() + 1), + true, GlobalVariable::PrivateLinkage, + ConstantDataArray::getString(F->getContext(), + F->getName(), true), + "SSH", false, 0); + CallInst::Create(StackChkFail, G, "", FailBB); + } else { + Constant *StackChkFail = + M->getOrInsertFunction("__stack_chk_fail", + Type::getVoidTy(F->getContext()), NULL); + CallInst::Create(StackChkFail, "", FailBB); + } new UnreachableInst(F->getContext(), FailBB); return FailBB; } Index: test/CodeGen/X86/stack-protector.ll =================================================================== --- test/CodeGen/X86/stack-protector.ll (revision 161795) +++ test/CodeGen/X86/stack-protector.ll (working copy) @@ -3,6 +3,8 @@ ; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %gs: ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_guard" ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_fail" +; RUN: llc -mtriple=x86_64-unknown-openbsd < %s -o - | grep "__guard" +; RUN: llc -mtriple=x86_64-unknown-openbsd < %s -o - | grep "__stack_smash_handler" @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1] From aaron at aaronballman.com Mon Aug 13 17:18:05 2012 From: aaron at aaronballman.com (Aaron Ballman) Date: Mon, 13 Aug 2012 18:18:05 -0400 Subject: [llvm-commits] [llvm] r161446 - /llvm/trunk/lib/CodeGen/StackProtector.cpp In-Reply-To: References: <20120807205905.834562A6C073@llvm.org> <10DC7282-B78D-449C-9EDC-DAFF7DBDBCF0@apple.com> Message-ID: On Mon, Aug 13, 2012 at 5:41 PM, Rafael Esp?ndola wrote: > On 13 August 2012 17:29, Aaron Ballman wrote: >> I'd like to ping this thread to see if we can get an consensus or not. >> I'm proposing we allow this feature to be controlled by a flag that's >> turned on by default for debug builds, even if it's not on Darwin. > > Probably depends on what you mean by "debug builds". The code > generated by the compiler should not depend on > > * The compiler itself being a debug build or not > * The -g flag > > I am almost sure it is OK to have a -ffull-stack-protector flag. It > might also make sense for -O0 -fstack-protector to default to it. I was talking about -O0. :-) ~Aaron From dblaikie at gmail.com Mon Aug 13 17:24:46 2012 From: dblaikie at gmail.com (David Blaikie) Date: Mon, 13 Aug 2012 22:24:46 -0000 Subject: [llvm-commits] [zorg] r161799 - in /zorg/trunk: buildbot/osuosl/master/config/builders.py zorg/buildbot/builders/ClangBuilder.py Message-ID: <20120813222446.D04B0352404C@llvm.org> Author: dblaikie Date: Mon Aug 13 17:24:46 2012 New Revision: 161799 URL: http://llvm.org/viewvc/llvm-project?rev=161799&view=rev Log: Experiment with a gdb/gcc dejagnu test runner in the lab. This is a bit cheesy just slapping it in as an option to the ClangBuilder, so if anyone has ideas how they'd like to see the variations, extension points, etc, implemented - feel free to let me know in post-commit review. I've done some experimentation with this locally, but without a mac box to run it against, so I'll be testing this in the lab with incremental/experimental commits for now. Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Modified: zorg/trunk/buildbot/osuosl/master/config/builders.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/osuosl/master/config/builders.py?rev=161799&r1=161798&r2=161799&view=diff ============================================================================== --- zorg/trunk/buildbot/osuosl/master/config/builders.py (original) +++ zorg/trunk/buildbot/osuosl/master/config/builders.py Mon Aug 13 17:24:46 2012 @@ -277,6 +277,11 @@ testerName='O0-g', run_cxx_tests=True, package_cache=LabPackageCache)}, + {'name' : "clang-x86_64-darwin10-gdb-gcc", + 'slavenames' :["lab-mini-04"], + 'builddir' :"clang-x86_64-darwin10-gdb-gcc", + 'factory' : ClangBuilder.getClangBuildFactory(run_gdb=True, run_gcc=True)}, + ] # Offline. Modified: zorg/trunk/zorg/buildbot/builders/ClangBuilder.py URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/builders/ClangBuilder.py?rev=161799&r1=161798&r2=161799&view=diff ============================================================================== --- zorg/trunk/zorg/buildbot/builders/ClangBuilder.py (original) +++ zorg/trunk/zorg/buildbot/builders/ClangBuilder.py Mon Aug 13 17:24:46 2012 @@ -37,7 +37,9 @@ trunk_revision=None, force_checkout=False, extra_clean_step=None, - checkout_compiler_rt=False): + checkout_compiler_rt=False, + run_gdb=False, + run_gcc=False): # Prepare environmental variables. Set here all env we want everywhere. merged_env = { 'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences. @@ -240,6 +242,14 @@ workdir=llvm_1_objdir, env=merged_env)) + if run_gdb or run_gcc: + ignores = getClangTestsIgnoresFromPath(os.path.expanduser('~/public/clang-tests'), 'clang-x86_64-darwin10') + install_prefix = "%%(builddir)s/%s" % llvm_1_installdir + if run_gdb: + addClangGDBTests(f, ignores, install_prefix) + if run_gcc: + addClangGCCTests(f, ignores, install_prefix) + if not useTwoStage: if package_dst: name = WithProperties( From grosbach at apple.com Mon Aug 13 17:25:44 2012 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 13 Aug 2012 22:25:44 -0000 Subject: [llvm-commits] [llvm] r161800 - in /llvm/trunk/test/MC/Disassembler/ARM: neon.txt neont2.txt Message-ID: <20120813222544.7F67E352404C@llvm.org> Author: grosbach Date: Mon Aug 13 17:25:44 2012 New Revision: 161800 URL: http://llvm.org/viewvc/llvm-project?rev=161800&view=rev Log: ARM: Move Thumb2 tests to Thumb2 test file and fix CHECK lines. These tests weren't actually being run before (missing ':' after CHECK). Modified: llvm/trunk/test/MC/Disassembler/ARM/neon.txt llvm/trunk/test/MC/Disassembler/ARM/neont2.txt Modified: llvm/trunk/test/MC/Disassembler/ARM/neon.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/neon.txt?rev=161800&r1=161799&r2=161800&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/ARM/neon.txt (original) +++ llvm/trunk/test/MC/Disassembler/ARM/neon.txt Mon Aug 13 17:25:44 2012 @@ -1931,14 +1931,6 @@ # CHECK: vmov.f32 d0, #1.600000e+01 # CHECK: vmov.f32 q0, #1.600000e+01 -# rdar://10798451 -0xe7 0xf9 0x32 0x1d -# CHECK vld2.8 {d17[], d19[]}, [r7, :16], r2 -0xe7 0xf9 0x3d 0x1d -# CHECK vld2.8 {d17[], d19[]}, [r7, :16]! -0xe7 0xf9 0x3f 0x1d -# CHECK vld2.8 {d17[], d19[]}, [r7, :16] - # rdar://11034702 0x0d 0x87 0x04 0xf4 # CHECK: vst1.8 {d8}, [r4]! Modified: llvm/trunk/test/MC/Disassembler/ARM/neont2.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/neont2.txt?rev=161800&r1=161799&r2=161800&view=diff ============================================================================== --- llvm/trunk/test/MC/Disassembler/ARM/neont2.txt (original) +++ llvm/trunk/test/MC/Disassembler/ARM/neont2.txt Mon Aug 13 17:25:44 2012 @@ -2042,3 +2042,13 @@ # CHECK: vld2.16 {d0[], d2[]}, [r3], r4 0xa3 0xf9 0xa4 0x0d # CHECK: vld2.32 {d0[], d2[]}, [r3], r4 + + +# rdar://10798451 +0xe7 0xf9 0x32 0x1d +# CHECK: vld2.8 {d17[], d19[]}, [r7, :16], r2 +0xe7 0xf9 0x3d 0x1d +# CHECK: vld2.8 {d17[], d19[]}, [r7, :16]! +0xe7 0xf9 0x3f 0x1d +# CHECK: vld2.8 {d17[], d19[]}, [r7, :16] + From eli.friedman at gmail.com Mon Aug 13 17:28:03 2012 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 13 Aug 2012 15:28:03 -0700 Subject: [llvm-commits] [PATCH] Make use of OpenBSD's libc routines for stack protector In-Reply-To: <20120813221018.GA19975@rox.home.comstyle.com> References: <20120809075229.GC28412@rox.home.comstyle.com> <20120811074915.GL28412@rox.home.comstyle.com> <20120813221018.GA19975@rox.home.comstyle.com> Message-ID: On Mon, Aug 13, 2012 at 3:10 PM, Brad Smith wrote: > On Sat, Aug 11, 2012 at 03:49:15AM -0400, Brad Smith wrote: >> On Thu, Aug 09, 2012 at 01:40:14AM -0700, Eli Friedman wrote: >> > On Thu, Aug 9, 2012 at 12:52 AM, Brad Smith wrote: >> > > This makes LLVM use OpenBSD's libc routines for stack protector. >> > >> > +#if defined(__OpenBSD__) >> > >> > This is wrong; you want to check if the target is OpenBSD, not if the >> > host is OpenBSD. >> >> You're right. How about this? > > Ok, here is the diff with a test addition. + if (Triple(TLI->getTargetMachine().getTargetTriple()).getOS() == llvm::Triple::OpenBSD) + StackGuardVar = M->getOrInsertGlobal("__guard", PtrTy); 80 columns. (Also elsewhere.) + if (Triple(TLI->getTargetMachine().getTargetTriple()).getOS() == llvm::Triple::OpenBSD) { + Constant *StackChkFail = + M->getOrInsertFunction("__stack_smash_handler", + Type::getVoidTy(F->getContext()), NULL); + Constant *G = new GlobalVariable(*M, + ArrayType::get(Type::getInt1Ty(F->getContext()), + F->getName().size() + 1), + true, GlobalVariable::PrivateLinkage, + ConstantDataArray::getString(F->getContext(), + F->getName(), true), + "SSH", false, 0); + CallInst::Create(StackChkFail, G, "", FailBB); You're declaring a global of type [N x i1], and initializing it with an initializer of type [N x i8]. Also this doesn't compile on trunk. -Eli From nrotem at apple.com Mon Aug 13 18:03:43 2012 From: nrotem at apple.com (Nadav Rotem) Date: Mon, 13 Aug 2012 23:03:43 -0000 Subject: [llvm-commits] [llvm] r161802 - in /llvm/trunk: lib/Analysis/MemoryDependenceAnalysis.cpp test/Analysis/GlobalsModRef/volatile-instrs.ll Message-ID: <20120813230343.BECFC352404C@llvm.org> Author: nadav Date: Mon Aug 13 18:03:43 2012 New Revision: 161802 URL: http://llvm.org/viewvc/llvm-project?rev=161802&view=rev Log: MemoryDependenceAnalysis attempts to find the first memory dependency for function calls. Currently, if GetLocation reports that it did not find a valid pointer (this is the case for volatile load/stores), we ignore the result. This patch adds code to handle the cases where we did not obtain a valid pointer. rdar://11872864 PR12899 Added: llvm/trunk/test/Analysis/GlobalsModRef/volatile-instrs.ll 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=161802&r1=161801&r2=161802&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Mon Aug 13 18:03:43 2012 @@ -227,13 +227,18 @@ // Otherwise if the two calls don't interact (e.g. InstCS is readnone) // keep scanning. - break; + continue; default: return MemDepResult::getClobber(Inst); } } + + // If we could not obtain a pointer for the instruction and the instruction + // touches memory then assume that this is a dependency. + if (MR != AliasAnalysis::NoModRef) + return MemDepResult::getClobber(Inst); } - + // No dependence found. If this is the entry block of the function, it is // unknown, otherwise it is non-local. if (BB != &BB->getParent()->getEntryBlock()) Added: llvm/trunk/test/Analysis/GlobalsModRef/volatile-instrs.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/GlobalsModRef/volatile-instrs.ll?rev=161802&view=auto ============================================================================== --- llvm/trunk/test/Analysis/GlobalsModRef/volatile-instrs.ll (added) +++ llvm/trunk/test/Analysis/GlobalsModRef/volatile-instrs.ll Mon Aug 13 18:03:43 2012 @@ -0,0 +1,34 @@ +; RUN: opt < %s -basicaa -dse -S | FileCheck %s + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.8.0" + +%struct.anon = type { i32, i32, i32 } + at b = global %struct.anon { i32 1, i32 0, i32 0 }, align 4 + at c = common global i32 0, align 4 + at a = common global %struct.anon zeroinitializer, align 4 + at .str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 + +declare i32 @printf(i8* nocapture, ...) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind + + +; Make sure that the initial memcpy call does not go away +; because the volatile load is in the way. PR12899 + +; CHECK: main_entry: +; CHECK-NEXT: tail call void @llvm.memcpy.p0i8.p0i8.i64 + +define i32 @main() nounwind uwtable ssp { +main_entry: + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false) + %0 = load volatile i32* getelementptr inbounds (%struct.anon* @b, i64 0, i32 0), align 4, !tbaa !0 + store i32 %0, i32* @c, align 4, !tbaa !0 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false) nounwind + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind + ret i32 0 +} + +!0 = metadata !{metadata !"int", metadata !1} +!1 = metadata !{metadata !"omnipotent char", metadata !2} +!2 = metadata !{metadata !"Simple C/C++ TBAA"} From nrotem at apple.com Mon Aug 13 18:06:55 2012 From: nrotem at apple.com (Nadav Rotem) Date: Mon, 13 Aug 2012 23:06:55 -0000 Subject: [llvm-commits] [llvm] r161803 - in /llvm/trunk: include/llvm/Support/ValueHandle.h lib/Transforms/Utils/SSAUpdater.cpp Message-ID: <20120813230655.1EDB6352404C@llvm.org> Author: nadav Date: Mon Aug 13 18:06:54 2012 New Revision: 161803 URL: http://llvm.org/viewvc/llvm-project?rev=161803&view=rev Log: LICM uses AliasSet information to hoist and sink instructions. However, other passes, such as LoopRotate may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly. This patch teaches SSAUpdater to notify AliasSet that it made changes. The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size. rdar://11872059 PR12901 Modified: llvm/trunk/include/llvm/Support/ValueHandle.h llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Modified: llvm/trunk/include/llvm/Support/ValueHandle.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ValueHandle.h?rev=161803&r1=161802&r2=161803&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/ValueHandle.h (original) +++ llvm/trunk/include/llvm/Support/ValueHandle.h Mon Aug 13 18:06:54 2012 @@ -110,11 +110,12 @@ V != DenseMapInfo::getTombstoneKey(); } -private: +public: // Callbacks made from Value. static void ValueIsDeleted(Value *V); static void ValueIsRAUWd(Value *Old, Value *New); +private: // Internal implementation details. ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); } HandleBaseKind getKind() const { return PrevPair.getInt(); } Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=161803&r1=161802&r2=161803&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original) +++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Mon Aug 13 18:06:54 2012 @@ -214,6 +214,11 @@ else V = GetValueInMiddleOfBlock(User->getParent()); + // Notify that users of the existing value that it is being replaced. + Value *OldVal = U.get(); + if (OldVal != V && OldVal->hasValueHandle()) + ValueHandleBase::ValueIsRAUWd(OldVal, V); + U.set(V); } From stoklund at 2pi.dk Mon Aug 13 18:13:23 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 23:13:23 -0000 Subject: [llvm-commits] [llvm] r161804 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Message-ID: <20120813231323.753F6352404C@llvm.org> Author: stoklund Date: Mon Aug 13 18:13:23 2012 New Revision: 161804 URL: http://llvm.org/viewvc/llvm-project?rev=161804&view=rev Log: Print out MachineBasicBlock successor weights when available. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=161804&r1=161803&r2=161804&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Aug 13 18:13:23 2012 @@ -311,8 +311,11 @@ if (!succ_empty()) { if (Indexes) OS << '\t'; OS << " Successors according to CFG:"; - for (const_succ_iterator SI = succ_begin(), E = succ_end(); SI != E; ++SI) + for (const_succ_iterator SI = succ_begin(), E = succ_end(); SI != E; ++SI) { OS << " BB#" << (*SI)->getNumber(); + if (!Weights.empty()) + OS << '(' << *getWeightIterator(SI) << ')'; + } OS << '\n'; } } From stoklund at 2pi.dk Mon Aug 13 18:13:25 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 23:13:25 -0000 Subject: [llvm-commits] [llvm] r161805 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Message-ID: <20120813231325.D68FB352404C@llvm.org> Author: stoklund Date: Mon Aug 13 18:13:25 2012 New Revision: 161805 URL: http://llvm.org/viewvc/llvm-project?rev=161805&view=rev Log: Transfer weights in transferSuccessorsAndUpdatePHIs(). Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=161805&r1=161804&r2=161805&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Aug 13 18:13:25 2012 @@ -535,14 +535,13 @@ while (!fromMBB->succ_empty()) { MachineBasicBlock *Succ = *fromMBB->succ_begin(); - uint32_t weight = 0; - + uint32_t Weight = 0; // If Weight list is empty it means we don't use it (disabled optimization). if (!fromMBB->Weights.empty()) - weight = *fromMBB->Weights.begin(); + Weight = *fromMBB->Weights.begin(); - addSuccessor(Succ, weight); + addSuccessor(Succ, Weight); fromMBB->removeSuccessor(Succ); } } @@ -554,7 +553,10 @@ while (!fromMBB->succ_empty()) { MachineBasicBlock *Succ = *fromMBB->succ_begin(); - addSuccessor(Succ); + uint32_t Weight = 0; + if (!fromMBB->Weights.empty()) + Weight = *fromMBB->Weights.begin(); + addSuccessor(Succ, Weight); fromMBB->removeSuccessor(Succ); // Fix up any PHI nodes in the successor. From kledzik at apple.com Mon Aug 13 18:28:44 2012 From: kledzik at apple.com (Nick Kledzik) Date: Mon, 13 Aug 2012 16:28:44 -0700 Subject: [llvm-commits] [PATCH] Add mapped_file_region for read/write mapped files. In-Reply-To: References: <7632ED28-671D-47DC-831A-956F4D6FA375@apple.com> Message-ID: <08F3F99C-B32D-408B-89A2-3368A2AC1E8B@apple.com> On Aug 13, 2012, at 2:21 PM, Michael Spencer wrote: > On Mon, Aug 6, 2012 at 5:26 PM, Nick Kledzik wrote: >> >> On Aug 6, 2012, at 3:37 PM, Michael Spencer wrote: >>> On Mon, Aug 6, 2012 at 2:58 PM, Nick Kledzik wrote: >>>>> + mapped_file_region(const Twine &path, >>>>> + mapmode mode, >>>>> + uint64_t length, >>>>> + uint64_t offset, >>>>> + error_code &ec); >>>> >>>> Something about constructors that also return an error_code sits wrong with me. In the error case, the constructor succeeds but you are left with a half constructed object. >>> >>> I don't like it either, but the alternatives don't allow RAII. And all >>> of them (except exceptions) require checking a value to make sure the >>> returned mapped_file_region is valid. >> I know, we've had other discussions about this issue. I keep hoping someone will have a clever solution. >> >>> >>>> By having the error_code at the end, you can now no longer use default values for the length and offset parameters. Your test case has to pass 0, 0 for them which is non-obvious what is happening. Since mapping the whole file is common, it would be nice if that case could just be called without the offset and length parameters. >>> >>> It's easy to just move ec to be the first parameter. >> It is nice have return/out parameters at the end... >> >>> >>>> To support unix and Windows which have different state requirements, you had to create another struct (mapstate) to encapsulate that. So now there are two structs to manage. >>> >>> mapstate is an internal implementation detail. Users don't know >>> anything about mapstate. >> My point was not about clients. It was that the implementation was complicated by the extra class. >> >>>> I would think it solve the above three issues and be cleaner to define an abstract base class and use a factory method for creation. Then the unix and Windows implementations have their own subclasses with the ivars they each need, and the factory method (in the .inc file) just calls the constructor on the concrete subclass. The interface in FileSystem.h would just be the abstract interface: >>>> >>>> class mapped_file_region { >>>> public; >>>> mapped_file_region() LLVM_EQ_DELETE; >>>> mapped_file_region(mapped_file_region&) LLVM_EQ_DELETE; >>>> mapped_file_region &operator =(mapped_file_region&) LLVM_EQ_DELETE; >>>> >>>> static mapped_file_region* make(const Twine &path, mapmode mode, uint64_t length=0, uint64_t offset=0); >>>> >>>> virtual error_code error() const; >>>> virtual mapmode flags() const; >>>> virtual uint64_t size() const; >>>> virtual char *data() const; >>>> }; >>> >>> I have two issues with this. The first is that mapped_file_region uses >>> RAII and move semantics to manage its lifetime, this forces users to >>> use delete or wrap it in an OwningPtr. >> Yes, the factory method idea precludes a client have a local variable that will automatically be destroyed at the end of the function or object. >> >> >>> The second is that there is no >>> reason to have virtual functions when only one implementation can ever >>> be used. >> I think the more general rule is don't use indirection what unnecessary. But your implementation used indirection by having just one ivar that points to the real ivars. So, both have an indirection. The virtual >> methods are just more obvious as indirection. >> >> The point of the indirection is to hide that the unix and Windows implementation are radically different and require different amounts of state. Maybe we should just push the indirection in the pre-processor. That is, >> in FileSystem.h have: >> >> class mapped_file_region { >> ? >> void *View; >> mapmode Mode; >> uint64_t Size; >> #if LLVM_ON_WIN32 >> int FD; >> HANDLE File; >> HANDLE FileMapping; >> #endif >> ? >> >> So the extra ivars show up when building for Windows but not for unix. Then there is no need for indirection! > > ok. > >> >>> >>> This also still has the problem of partially constructed objects. >> Yes, that is why I had a separate error() method to check for failure. >> >> A variation on this is to have the constructor just assign ivars and not actually try to do the mapping, and thus cannot fail. Instead we add a method: >> error_code map(); >> which does the mapping and can fail. > > Still leaves us with partially constructed objects. > >> I think the import part is that all the methods that operate on the object fire an assertion if called on a "partially constructed" object. > > I agree. > > Attached is an updated patch. Much nicer! I'm fine with you committing this now. -Nick >>> >>>> >>>>> + int flags = mode == mapped_file_region::readwrite ? MAP_SHARED : MAP_PRIVATE; >>>> I also found this hard to parse. How about: >>>> >>>> int flags = ((mode == mapped_file_region::readwrite) ? MAP_SHARED : MAP_PRIVATE); >>> >>> ok. >>> >>>> -Nick >>> >>> - Michael Spencer >>> >>>> >>>> >>>> On Aug 6, 2012, at 2:00 PM, Michael Spencer wrote: >>>>> The attached patch adds mapped_file_region based on >>>>> boost::iostreams::mapped_file. This is a replacement for >>>>> map_file_pages/unmap_file_pages to work properly on Windows. This can >>>>> also be used by MemoryBuffer to finally have memory mapped files on >>>>> Windows. >>>>> >>>>> The reason the previous APIs do not work for Windows is that there are >>>>> 3 different handles that need to be kept track of to properly unmap a >>>>> region. For munmap there is only 1. >>>>> >>>>> - Michael Spencer >>>>> <0001-PathV2-Add-mapped_file_region.-Implementation-for-Wi.patch> >>>> >> > <0001-PathV2-Add-mapped_file_region.-Implementation-for-Wi.patch> From resistor at mac.com Mon Aug 13 18:32:49 2012 From: resistor at mac.com (Owen Anderson) Date: Mon, 13 Aug 2012 23:32:49 -0000 Subject: [llvm-commits] [llvm] r161807 - in /llvm/trunk: include/llvm/ADT/APFloat.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp lib/Support/APFloat.cpp test/CodeGen/ARM/floorf.ll Message-ID: <20120813233249.F2EA2352404C@llvm.org> Author: resistor Date: Mon Aug 13 18:32:49 2012 New Revision: 161807 URL: http://llvm.org/viewvc/llvm-project?rev=161807&view=rev Log: Add a roundToIntegral method to APFloat, which can be parameterized over various rounding modes. Use this to implement SelectionDAG constant folding of FFLOOR, FCEIL, and FTRUNC. Added: llvm/trunk/test/CodeGen/ARM/floorf.ll Modified: llvm/trunk/include/llvm/ADT/APFloat.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/include/llvm/ADT/APFloat.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APFloat.h?rev=161807&r1=161806&r2=161807&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/APFloat.h (original) +++ llvm/trunk/include/llvm/ADT/APFloat.h Mon Aug 13 18:32:49 2012 @@ -274,6 +274,7 @@ /* C fmod, or llvm frem. */ opStatus mod(const APFloat &, roundingMode); opStatus fusedMultiplyAdd(const APFloat &, const APFloat &, roundingMode); + opStatus roundToIntegral(roundingMode); /* Sign operations. */ void changeSign(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=161807&r1=161806&r2=161807&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Aug 13 18:32:49 2012 @@ -228,6 +228,9 @@ SDValue visitFP_EXTEND(SDNode *N); SDValue visitFNEG(SDNode *N); SDValue visitFABS(SDNode *N); + SDValue visitFCEIL(SDNode *N); + SDValue visitFTRUNC(SDNode *N); + SDValue visitFFLOOR(SDNode *N); SDValue visitBRCOND(SDNode *N); SDValue visitBR_CC(SDNode *N); SDValue visitLOAD(SDNode *N); @@ -1140,6 +1143,9 @@ case ISD::FP_EXTEND: return visitFP_EXTEND(N); case ISD::FNEG: return visitFNEG(N); case ISD::FABS: return visitFABS(N); + case ISD::FFLOOR: return visitFFLOOR(N); + case ISD::FCEIL: return visitFCEIL(N); + case ISD::FTRUNC: return visitFTRUNC(N); case ISD::BRCOND: return visitBRCOND(N); case ISD::BR_CC: return visitBR_CC(N); case ISD::LOAD: return visitLOAD(N); @@ -6243,6 +6249,42 @@ return SDValue(); } +SDValue DAGCombiner::visitFCEIL(SDNode *N) { + SDValue N0 = N->getOperand(0); + ConstantFPSDNode *N0CFP = dyn_cast(N0); + EVT VT = N->getValueType(0); + + // fold (fceil c1) -> fceil(c1) + if (N0CFP && VT != MVT::ppcf128) + return DAG.getNode(ISD::FCEIL, N->getDebugLoc(), VT, N0); + + return SDValue(); +} + +SDValue DAGCombiner::visitFTRUNC(SDNode *N) { + SDValue N0 = N->getOperand(0); + ConstantFPSDNode *N0CFP = dyn_cast(N0); + EVT VT = N->getValueType(0); + + // fold (ftrunc c1) -> ftrunc(c1) + if (N0CFP && VT != MVT::ppcf128) + return DAG.getNode(ISD::FTRUNC, N->getDebugLoc(), VT, N0); + + return SDValue(); +} + +SDValue DAGCombiner::visitFFLOOR(SDNode *N) { + SDValue N0 = N->getOperand(0); + ConstantFPSDNode *N0CFP = dyn_cast(N0); + EVT VT = N->getValueType(0); + + // fold (ffloor c1) -> ffloor(c1) + if (N0CFP && VT != MVT::ppcf128) + return DAG.getNode(ISD::FFLOOR, N->getDebugLoc(), VT, N0); + + return SDValue(); +} + SDValue DAGCombiner::visitFABS(SDNode *N) { SDValue N0 = N->getOperand(0); ConstantFPSDNode *N0CFP = dyn_cast(N0); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=161807&r1=161806&r2=161807&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 13 18:32:49 2012 @@ -2483,6 +2483,24 @@ case ISD::FABS: V.clearSign(); return getConstantFP(V, VT); + case ISD::FCEIL: { + APFloat::opStatus fs = V.roundToIntegral(APFloat::rmTowardPositive); + if (fs == APFloat::opOK || fs == APFloat::opInexact) + return getConstantFP(V, VT); + break; + } + case ISD::FTRUNC: { + APFloat::opStatus fs = V.roundToIntegral(APFloat::rmTowardZero); + if (fs == APFloat::opOK || fs == APFloat::opInexact) + return getConstantFP(V, VT); + break; + } + case ISD::FFLOOR: { + APFloat::opStatus fs = V.roundToIntegral(APFloat::rmTowardNegative); + if (fs == APFloat::opOK || fs == APFloat::opInexact) + return getConstantFP(V, VT); + break; + } case ISD::FP_EXTEND: { bool ignored; // This can return overflow, underflow, or inexact; we don't care. Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=161807&r1=161806&r2=161807&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Mon Aug 13 18:32:49 2012 @@ -1765,6 +1765,32 @@ return fs; } +/* Rounding-mode corrrect round to integral value. */ +APFloat::opStatus APFloat::roundToIntegral(roundingMode rounding_mode) { + opStatus fs; + assertArithmeticOK(*semantics); + + // The algorithm here is quite simple: we add 2^(p-1), where p is the + // precision of our format, and then subtract it back off again. The choice + // of rounding modes for the addition/subtraction determines the rounding mode + // for our integral rounding as well. + APInt IntegerConstant(NextPowerOf2(semanticsPrecision(*semantics)), + 1 << (semanticsPrecision(*semantics)-1)); + APFloat MagicConstant(*semantics); + fs = MagicConstant.convertFromAPInt(IntegerConstant, false, + rmNearestTiesToEven); + if (fs != opOK) + return fs; + + fs = add(MagicConstant, rounding_mode); + if (fs != opOK && fs != opInexact) + return fs; + + fs = subtract(MagicConstant, rounding_mode); + return fs; +} + + /* Comparison requires normalized numbers. */ APFloat::cmpResult APFloat::compare(const APFloat &rhs) const Added: llvm/trunk/test/CodeGen/ARM/floorf.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/floorf.ll?rev=161807&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/floorf.ll (added) +++ llvm/trunk/test/CodeGen/ARM/floorf.ll Mon Aug 13 18:32:49 2012 @@ -0,0 +1,29 @@ +; RUN: llc -march=arm < %s | FileCheck %s + +; CHECK: test1 +define float @test1() nounwind uwtable readnone ssp { +; CHECK-NOT: floorf + %foo = call float @floorf(float 0x4000CCCCC0000000) nounwind readnone + ret float %foo +} + +; CHECK: test2 +define float @test2() nounwind uwtable readnone ssp { +; CHECK-NOT: ceilf + %foo = call float @ceilf(float 0x4000CCCCC0000000) nounwind readnone + ret float %foo +} + +; CHECK: test3 +define float @test3() nounwind uwtable readnone ssp { +; CHECK-NOT: truncf + %foo = call float @truncf(float 0x4000CCCCC0000000) nounwind readnone + ret float %foo +} + +declare float @floorf(float) nounwind readnone +declare float @ceilf(float) nounwind readnone +declare float @truncf(float) nounwind readnone + + + From apazos at codeaurora.org Mon Aug 13 19:08:05 2012 From: apazos at codeaurora.org (Ana Pazos) Date: Mon, 13 Aug 2012 17:08:05 -0700 Subject: [llvm-commits] fix bug 13240 - ARM PLD/PLDW (register) with -ve Rm and a right-shift by #32 reencodes as +ve Rm Message-ID: <001801cd79b0$e0fffc10$a2fff430$@codeaurora.org> Hello reviewers, The attached patch fixes the MC issue with PLD/PLDW instructions in ARM mode reported in bug http://llvm.org/bugs/show_bug.cgi?id=13240. Also added test cases to cover these instructions. Let me know what you think. Thanks, Ana. -- Qualcomm Innovation Center, Inc is a member of Code Aurora Forum -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/53c659d6/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: patchLLVMBug13240.diff Type: application/octet-stream Size: 1792 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/53c659d6/attachment.obj From rafael.espindola at gmail.com Mon Aug 13 19:17:01 2012 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 13 Aug 2012 20:17:01 -0400 Subject: [llvm-commits] [llvm] r161446 - /llvm/trunk/lib/CodeGen/StackProtector.cpp In-Reply-To: References: <20120807205905.834562A6C073@llvm.org> <10DC7282-B78D-449C-9EDC-DAFF7DBDBCF0@apple.com> Message-ID: > I was talking about -O0. :-) I don't particularly have an opinion about it, but there is some precedent (-fomit-frame-pointer for example), so my suggestion is to write a patch adding a -ffull-stack-protector and another one changing the default at -O0 and see what people think. > ~Aaron Cheers, Rafael From mgottesman at apple.com Mon Aug 13 19:25:52 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:25:52 -0000 Subject: [llvm-commits] [LNT] r161812 - in /lnt/trunk/lnt/server/ui: filters.py util.py Message-ID: <20120814002552.E0C64352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:25:52 2012 New Revision: 161812 URL: http://llvm.org/viewvc/llvm-project?rev=161812&view=rev Log: [LNT] Update lnt.server.ui.utils.PctCell to allow specifying the cell class. Modified: lnt/trunk/lnt/server/ui/filters.py lnt/trunk/lnt/server/ui/util.py Modified: lnt/trunk/lnt/server/ui/filters.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/filters.py?rev=161812&r1=161811&r2=161812&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/filters.py (original) +++ lnt/trunk/lnt/server/ui/filters.py Mon Aug 13 19:25:52 2012 @@ -9,9 +9,9 @@ ts = datetime.datetime.fromtimestamp(time) return ts.strftime('%Y-%m-%d %H:%M:%S %Z PST') -def filter_aspctcell(value, *args, **kwargs): +def filter_aspctcell(value, class_=None, style=None, *args, **kwargs): cell = util.PctCell(value, *args, **kwargs) - return cell.render() + return cell.render(class_, style) def filter_pprint(value): stream = StringIO.StringIO() Modified: lnt/trunk/lnt/server/ui/util.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=161812&r1=161811&r2=161812&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/util.py (original) +++ lnt/trunk/lnt/server/ui/util.py Mon Aug 13 19:25:52 2012 @@ -208,14 +208,15 @@ for v in self.getColor()] return "#%02x%02x%02x" % (r,g,b) - def render(self, style=None): - if style is None: - style_string = "" - else: - style_string = ' style="%s"' % (style,) - res = '%s' % ( - style_string, self.getColorString(), self.getValue()) - return res + def render(self, class_=None, style=None): + attrs = [] + if style is not None: + attrs.append('style="%s"' % (style,)) + if class_ is not None: + attrs.append('class="%s"' % (class_,)) + attrs.append('bgcolor="%s"' % (self.getColorString(),)) + attr_string = ' '.join(attrs) + return '%s' % (attr_string, self.getValue()) def sorted(l, *args, **kwargs): l = list(l) From mgottesman at apple.com Mon Aug 13 19:25:59 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:25:59 -0000 Subject: [llvm-commits] [LNT] r161814 - /lnt/trunk/lnt/server/ui/views.py Message-ID: <20120814002600.0A99C352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:25:59 2012 New Revision: 161814 URL: http://llvm.org/viewvc/llvm-project?rev=161814&view=rev Log: [LNT] Removed extraneous imports from views.py. Removed csv, cStringIO, and json. Modified: lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161814&r1=161813&r2=161814&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 19:25:59 2012 @@ -3,9 +3,6 @@ import re import tempfile import time -import csv -import cStringIO -import json import flask from flask import abort From mgottesman at apple.com Mon Aug 13 19:26:03 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:26:03 -0000 Subject: [llvm-commits] [LNT] r161815 - /lnt/trunk/lnt/server/ui/views.py Message-ID: <20120814002603.1CED1352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:26:02 2012 New Revision: 161815 URL: http://llvm.org/viewvc/llvm-project?rev=161815&view=rev Log: [LNT] Fixed incorrect comment. Modified: lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161815&r1=161814&r2=161815&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 19:26:02 2012 @@ -646,8 +646,8 @@ # Create a datetime for the day before the most recent run. yesterday = latest_date - datetime.timedelta(days=1) - # Get the revision number for a nondefault baseline if we - # are given one. + # Get the revision number for the default baseline and look up + # the fields we are interested in. revision = ts.Machine.DEFAULT_BASELINE_REVISION field = ts.Sample.get_primary_fields().next() From mgottesman at apple.com Mon Aug 13 19:25:56 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:25:56 -0000 Subject: [llvm-commits] [LNT] r161813 - in /lnt/trunk/lnt/server/ui: static/v4_global_status.css templates/v4_global_status.html templates/v4_overview.html views.py Message-ID: <20120814002557.035AC352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:25:56 2012 New Revision: 161813 URL: http://llvm.org/viewvc/llvm-project?rev=161813&view=rev Log: [LNT] Commit of initial version of global status page. This page shows the performance change of all tests on all machines from the previous day against a particular baseline. Added: lnt/trunk/lnt/server/ui/static/v4_global_status.css lnt/trunk/lnt/server/ui/templates/v4_global_status.html Modified: lnt/trunk/lnt/server/ui/templates/v4_overview.html lnt/trunk/lnt/server/ui/views.py Added: lnt/trunk/lnt/server/ui/static/v4_global_status.css URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/v4_global_status.css?rev=161813&view=auto ============================================================================== --- lnt/trunk/lnt/server/ui/static/v4_global_status.css (added) +++ lnt/trunk/lnt/server/ui/static/v4_global_status.css Mon Aug 13 19:25:56 2012 @@ -0,0 +1,47 @@ + +table#data-table tr { + width: 100%; +} + +table#data-table th { + outline: rgba(0, 0, 0, 0.3) solid 1px; +} + +/* Turn off text select */ +table#data-table { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + user-select: none; + margin-right: 10px; + cursor: default; +} + +table#data-table td { + border: rgba(0, 0, 0, 0.3) solid 1px; +} + +table#data-table td.data-cell, table#data-table th { + text-align: center; +} + +table#data-table td.data-cell, table#data-table th.data-header { + min-width: 15em; + max-width: 15em; + width: 15em; +} + +table#data-table td.row-head { + min-width: 30em; + max-width: 30em; + width: 30em; +} + +table#data-table th.label-header { + width: auto; +} + +table#data-table td.row-head { + text-align: left; + overflow: hidden; +} Added: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161813&view=auto ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (added) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 19:25:56 2012 @@ -0,0 +1,37 @@ +{% import "v4_utils.html" as v4_utils %} +{% import "utils.html" as utils %} + +{% extends "layout.html" %} +{% set components = [(ts.name, v4_url_for("v4_global_status"))] %} +{% block head %} + + + +{% endblock %} + +{% block title %}Global Status - {{ + selected_field.name.replace("_", " ").title() }}{% endblock %} + +{% block body %} + + + + + {% for m in machines %} + + {% endfor %} + + {% for row in tests %} + + + {{ row[1]|aspctcell("data-cell worst-time")|safe }} + {% for cr in row[2:] %} + {{ cr.pct_delta|aspctcell("data-cell worst-time")|safe }} + {% endfor %} + + {% endfor %} +
TestWorst Time{{ m.name }}
+ {{ row[0] }} +
+{% endblock %} Modified: lnt/trunk/lnt/server/ui/templates/v4_overview.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_overview.html?rev=161813&r1=161812&r2=161813&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_overview.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_overview.html Mon Aug 13 19:25:56 2012 @@ -5,6 +5,10 @@ {% block title %}Overview{% endblock %} {% block body %} +

Compiler Status Pages

+Compile Time +Execution Time + {# Find recent runs. #}

Submission Overview

Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161813&r1=161812&r2=161813&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 19:25:56 2012 @@ -3,6 +3,9 @@ import re import tempfile import time +import csv +import cStringIO +import json import flask from flask import abort @@ -14,6 +17,8 @@ from flask import request from flask import url_for +import sqlalchemy.sql + import lnt.util import lnt.util.ImportData import lnt.util.stats @@ -21,6 +26,7 @@ import lnt.server.reporting.analysis import lnt.server.reporting.runs from lnt.server.ui.decorators import frontend, db_route, v4_route +import lnt.server.ui.util ### # Root-Only Routes @@ -492,7 +498,7 @@ errorbar_data = [] points_data = [] pts = [] - + # Create region of interest for run data region if # we are performing a comparison. if compare_to: @@ -502,7 +508,7 @@ convert_revision(start_rev), convert_revision(end_rev) ) - + if normalize_by_median: normalize_by = 1.0/stats.median([min(values) for _,values in data]) @@ -572,14 +578,14 @@ style = "new Graph2D_LinePlotStyle(2, %r)" % (reglin_col,) graph_plots.append("graph.addPlot([%s], %s);" % ( pts,style)) - - # If we are comparing two revisions, + + # If we are comparing two revisions, if compare_to: reg_col = [0.0, 0.0, 1.0] graph_plots.append("graph.addPlot([%i, %i],%s);" % ( revision_range_region[0], revision_range_region[1], "new Graph2D_RangePlotStyle(%r)" % reg_col)) - + # Add the points plot, if used. if points_data: pts_col = (0,0,0) @@ -623,6 +629,97 @@ return redirect(v4_url_for("v4_daily_report", year=date.year, month=date.month, day=date.day)) + at v4_route("/global_status") +def v4_global_status(): + from lnt.server.ui import util + + ts = request.get_testsuite() + + # Get the latest run. + latest = ts.query(ts.Run.start_time).\ + order_by(ts.Run.start_time.desc()).first() + + # If we found an entry, use that. + if latest is not None: + latest_date, = latest + else: + # Otherwise, just use today. + latest_date = datetime.date.today() + + # Create a datetime for the day before the most recent run. + yesterday = latest_date - datetime.timedelta(days=1) + + # Get the revision number for a nondefault baseline if we + # are given one. + revision = ts.Machine.DEFAULT_BASELINE_REVISION + field = ts.Sample.get_primary_fields().next() + + # Get the list of all runs we might be interested in. + recent_runs = ts.query(ts.Run).filter(ts.Run.start_time > yesterday).all() + + # Aggregate the runs by machine. + recent_runs_by_machine = util.multidict() + for run in recent_runs: + recent_runs_by_machine[run.machine] = run + + # Get a sorted list of recent machines. + recent_machines = sorted(recent_runs_by_machine.keys(), + key=lambda m: m.name) + + # For each machine, build a table of the machine, the baseline run, and the + # most recent run. We also computed a list of all the runs we are reporting + # over. + machine_run_info = [] + reported_run_ids = [] + for machine in recent_machines: + runs = recent_runs_by_machine[machine] + + # Get the baseline run for this machine. + baseline = machine.get_baseline_run(revision) + + # Choose the "best" run to report on. We want the most recent one with + # the most recent order. + run = max(runs, key=lambda r: (r.order, r.start_time)) + + machine_run_info.append((baseline, run)) + reported_run_ids.append(baseline.id) + reported_run_ids.append(run.id) + + # Get the set all tests reported in the recent runs. + reported_tests = ts.query(ts.Test.id, ts.Test.name).filter( + sqlalchemy.sql.exists('*', sqlalchemy.sql.and_( + ts.Sample.run_id.in_(reported_run_ids), + ts.Sample.test_id == ts.Test.id))).all() + + # Load all of the runs we are interested in. + runinfo = lnt.server.reporting.analysis.RunInfo(ts, reported_run_ids) + + # Build the test matrix. This is a two dimensional table index by + # (machine-index, test-index), where each entry is the percent change. + test_table = [] + for i,(test_id,test_name) in enumerate(reported_tests): + # Create the row, starting with the test name and worst entry. + row = [test_name, None] + + # Compute comparison results for each machine. + row.extend(runinfo.get_run_comparison_result(run, baseline, test_id, + field) + for baseline,run in machine_run_info) + + # Compute the worst cell value. + row[1] = max(cr.pct_delta + for cr in row[2:]) + + test_table.append(row) + + # Order the table by worst regression. + test_table.sort(key = lambda row: row[1], reverse=True) + + return render_template("v4_global_status.html", + ts=ts, + tests=test_table, + machines=recent_machines, + selected_field=field) @v4_route("/daily_report///") def v4_daily_report(year, month, day): From mgottesman at apple.com Mon Aug 13 19:26:06 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:26:06 -0000 Subject: [llvm-commits] [LNT] r161816 - in /lnt/trunk/lnt/server/ui: templates/v4_global_status.html views.py Message-ID: <20120814002606.4C1E0352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:26:06 2012 New Revision: 161816 URL: http://llvm.org/viewvc/llvm-project?rev=161816&view=rev Log: [LNT] Added code which generates css class groupings and appends them to our data cells/headers so we can easily hide/show columns by toggling css classes on the parent container of v4_global_status.html. Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161816&r1=161815&r2=161816&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 19:26:06 2012 @@ -19,7 +19,7 @@ {% for m in machines %} - + {% endfor %} {% for row in tests %} @@ -29,7 +29,7 @@ {{ row[1]|aspctcell("data-cell worst-time")|safe }} {% for cr in row[2:] %} - {{ cr.pct_delta|aspctcell("data-cell worst-time")|safe }} + {{ cr.pct_delta|aspctcell("data-cell worst-time " + machine_groups_map[machines[loop.index0]])|safe }} {% endfor %} {% endfor %} Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161816&r1=161815&r2=161816&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 19:26:06 2012 @@ -668,6 +668,10 @@ # over. machine_run_info = [] reported_run_ids = [] + + # Create groupings based off of the names of our input machines. + grouping_set = set() + machine_groups_map = {} for machine in recent_machines: runs = recent_runs_by_machine[machine] @@ -682,6 +686,26 @@ reported_run_ids.append(baseline.id) reported_run_ids.append(run.id) + machine_groupings = machine.name.split('.') + machine_groups_map[machine] = machine_groupings + grouping_set = grouping_set.union(machine_groupings) + + # Invert machine name to groupings map and add in inverse names as classname with the not-prefix. This allows + # us to hide certain columns by changing the class on the table. + for machine in machine_groups_map: + groups = machine_groups_map[machine] + + # If a machine does not have O0 or Os in its name, + # we treat it as an O3 run. This is to be compatible + # with our current naming scheme. + if not 'O0' in groups and not 'Os' in groups: + groups.append('O3') + + # Add in inverse groups. + groups.extend("not-" + x for x in grouping_set.difference(groups)) + + machine_groups_map[machine] = ' '.join(groups) + # Get the set all tests reported in the recent runs. reported_tests = ts.query(ts.Test.id, ts.Test.name).filter( sqlalchemy.sql.exists('*', sqlalchemy.sql.and_( @@ -716,6 +740,7 @@ ts=ts, tests=test_table, machines=recent_machines, + machine_groups_map=machine_groups_map, selected_field=field) @v4_route("/daily_report///") From mgottesman at apple.com Mon Aug 13 19:26:09 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:26:09 -0000 Subject: [llvm-commits] [LNT] r161817 - /lnt/trunk/lnt/server/ui/templates/v4_global_status.html Message-ID: <20120814002609.6854C352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:26:09 2012 New Revision: 161817 URL: http://llvm.org/viewvc/llvm-project?rev=161817&view=rev Log: [LNT] Global status overview page data columns are not all apart of the class 'worst-time', just the second data column. Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161817&r1=161816&r2=161817&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 19:26:09 2012 @@ -29,7 +29,7 @@ {{ row[1]|aspctcell("data-cell worst-time")|safe }} {% for cr in row[2:] %} - {{ cr.pct_delta|aspctcell("data-cell worst-time " + machine_groups_map[machines[loop.index0]])|safe }} + {{ cr.pct_delta|aspctcell("data-cell " + machine_groups_map[machines[loop.index0]])|safe }} {% endfor %} {% endfor %} From mgottesman at apple.com Mon Aug 13 19:26:13 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 00:26:13 -0000 Subject: [llvm-commits] [LNT] r161818 - in /lnt/trunk/lnt/server: db/testsuitedb.py ui/templates/v4_global_status.html ui/views.py Message-ID: <20120814002613.12F8A352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 19:26:12 2012 New Revision: 161818 URL: http://llvm.org/viewvc/llvm-project?rev=161818&view=rev Log: [LNT] Added code to v4_global_status.html so that the proper css classes for the table to show/hide classes are generated. Modified: lnt/trunk/lnt/server/db/testsuitedb.py lnt/trunk/lnt/server/ui/templates/v4_global_status.html lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/db/testsuitedb.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuitedb.py?rev=161818&r1=161817&r2=161818&view=diff ============================================================================== --- lnt/trunk/lnt/server/db/testsuitedb.py (original) +++ lnt/trunk/lnt/server/db/testsuitedb.py Mon Aug 13 19:26:12 2012 @@ -65,6 +65,7 @@ fields = self.machine_fields id = Column("ID", Integer, primary_key=True) name = Column("Name", String(256), index=True) + _css_name = None # The parameters blob is used to store any additional information # reported by the run but not promoted into the machine record. Such @@ -97,7 +98,14 @@ @parameters.setter def parameters(self, data): self.parameters_data = json.dumps(sorted(data.items())) - + + def get_css_name(self): + """ Lazy method which returns a safe css name to + represent this machine.""" + if self._css_name is None: + self._css_name = self.name.replace('.','-') + return self._css_name + def get_baseline_run(self, revision=None): """ Find the closest order to the requested baseline Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161818&r1=161817&r2=161818&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 19:26:12 2012 @@ -8,6 +8,27 @@ href="{{ url_for('.static', filename='v4_global_status.css') }}"> + + {% endblock %} {% block title %}Global Status - {{ @@ -19,7 +40,7 @@ {% for m in machines %} - + {% endfor %} {% for row in tests %} @@ -29,7 +50,7 @@ {{ row[1]|aspctcell("data-cell worst-time")|safe }} {% for cr in row[2:] %} - {{ cr.pct_delta|aspctcell("data-cell " + machine_groups_map[machines[loop.index0]])|safe }} + {{ cr.pct_delta|aspctcell("data-cell " + machines[loop.index0].get_css_name() + " " + machine_groups_map[machines[loop.index0]])|safe }} {% endfor %} {% endfor %} Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161818&r1=161817&r2=161818&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 19:26:12 2012 @@ -669,8 +669,9 @@ machine_run_info = [] reported_run_ids = [] - # Create groupings based off of the names of our input machines. - grouping_set = set() + # Create groupings based off of the names of our input machines. + grouping_set = set(['O3']) # Due to the default way we name our machines, + # we need to add O3 since no O0/Os => O3. machine_groups_map = {} for machine in recent_machines: runs = recent_runs_by_machine[machine] @@ -690,20 +691,21 @@ machine_groups_map[machine] = machine_groupings grouping_set = grouping_set.union(machine_groupings) - # Invert machine name to groupings map and add in inverse names as classname with the not-prefix. This allows - # us to hide certain columns by changing the class on the table. + # Invert machine name to groupings map and add in inverse names as + # classname with the not-prefix. This allows us to hide certain + # columns by changing the class on the table. for machine in machine_groups_map: groups = machine_groups_map[machine] - - # If a machine does not have O0 or Os in its name, - # we treat it as an O3 run. This is to be compatible - # with our current naming scheme. + + # If a machine does not have O0 or Os in its name, we treat it + # as an O3 run. This is to be compatible with our current + # naming scheme. if not 'O0' in groups and not 'Os' in groups: groups.append('O3') - + # Add in inverse groups. groups.extend("not-" + x for x in grouping_set.difference(groups)) - + machine_groups_map[machine] = ' '.join(groups) # Get the set all tests reported in the recent runs. @@ -741,6 +743,7 @@ tests=test_table, machines=recent_machines, machine_groups_map=machine_groups_map, + groups = list(grouping_set), selected_field=field) @v4_route("/daily_report///") From craig.topper at gmail.com Mon Aug 13 19:42:29 2012 From: craig.topper at gmail.com (Craig Topper) Date: Mon, 13 Aug 2012 17:42:29 -0700 Subject: [llvm-commits] [llvm] r161769 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/vec_ss_load_fold.ll In-Reply-To: <20120813182942.30BA6352404C@llvm.org> References: <20120813182942.30BA6352404C@llvm.org> Message-ID: I somewhat wonder if folding of scalar intrinsics works completely correctly. Those intrinsics have VR128 as their register class, but the load size is actually 32/64-bits. I think the folding code looks at the register class size to determine size. Adding Jakob for comment. ~Craig On Mon, Aug 13, 2012 at 11:29 AM, Manman Ren wrote: > Author: mren > Date: Mon Aug 13 13:29:41 2012 > New Revision: 161769 > > URL: http://llvm.org/viewvc/llvm-project?rev=161769&view=rev > Log: > X86: move Int_CVTSD2SSrr, Int_CVTSI2SSrr, Int_CVTSI2SDrr, Int_CVTSS2SDrr > from > OpTbl1 to OpTbl2 since they have 3 operands and the last operand can be > changed > to a memory operand. > > PR13576 > > Modified: > llvm/trunk/lib/Target/X86/X86InstrInfo.cpp > llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=161769&r1=161768&r2=161769&view=diff > > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Aug 13 13:29:41 2012 > @@ -414,12 +414,6 @@ > { X86::CVTSD2SIrr, X86::CVTSD2SIrm, 0 }, > { X86::CVTSS2SI64rr, X86::CVTSS2SI64rm, 0 }, > { X86::CVTSS2SIrr, X86::CVTSS2SIrm, 0 }, > - { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm, 0 }, > - { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm, 0 }, > - { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm, 0 }, > - { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm, 0 }, > - { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm, 0 }, > - { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm, 0 }, > { X86::CVTTPD2DQrr, X86::CVTTPD2DQrm, TB_ALIGN_16 }, > { X86::CVTTPS2DQrr, X86::CVTTPS2DQrm, TB_ALIGN_16 }, > { X86::Int_CVTTSD2SI64rr,X86::Int_CVTTSD2SI64rm, 0 }, > @@ -680,6 +674,12 @@ > { X86::IMUL64rr, X86::IMUL64rm, 0 }, > { X86::Int_CMPSDrr, X86::Int_CMPSDrm, 0 }, > { X86::Int_CMPSSrr, X86::Int_CMPSSrm, 0 }, > + { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm, 0 }, > + { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm, 0 }, > + { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm, 0 }, > + { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm, 0 }, > + { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm, 0 }, > + { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm, 0 }, > { X86::MAXPDrr, X86::MAXPDrm, TB_ALIGN_16 }, > { X86::MAXPDrr_Int, X86::MAXPDrm_Int, TB_ALIGN_16 }, > { X86::MAXPSrr, X86::MAXPSrm, TB_ALIGN_16 }, > > Modified: llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll?rev=161769&r1=161768&r2=161769&view=diff > > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll (original) > +++ llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Mon Aug 13 13:29:41 > 2012 > @@ -70,3 +70,17 @@ > ; CHECK: call > ; CHECK: roundss $4, %xmm{{.*}}, %xmm0 > } > + > +; PR13576 > +define <2 x double> @test5() nounwind uwtable readnone noinline { > +entry: > + %0 = tail call <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double> +4.569870e+02, double 1.233210e+02>, i32 128) nounwind readnone > + ret <2 x double> %0 > +; CHECK: test5: > +; CHECK: movl > +; CHECK: mov > +; CHECK: cvtsi2sd > +} > + > +declare <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double>, i32) nounwind > readnone > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -- ~Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/f84fbe16/attachment.html From eli.friedman at gmail.com Mon Aug 13 19:44:14 2012 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 13 Aug 2012 17:44:14 -0700 Subject: [llvm-commits] [llvm] r161803 - in /llvm/trunk: include/llvm/Support/ValueHandle.h lib/Transforms/Utils/SSAUpdater.cpp In-Reply-To: <20120813230655.1EDB6352404C@llvm.org> References: <20120813230655.1EDB6352404C@llvm.org> Message-ID: On Mon, Aug 13, 2012 at 4:06 PM, Nadav Rotem wrote: > Author: nadav > Date: Mon Aug 13 18:06:54 2012 > New Revision: 161803 > > URL: http://llvm.org/viewvc/llvm-project?rev=161803&view=rev > Log: > LICM uses AliasSet information to hoist and sink instructions. However, other passes, such as LoopRotate > may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly. > This patch teaches SSAUpdater to notify AliasSet that it made changes. > The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size. > > rdar://11872059 PR12901 > > > Modified: > llvm/trunk/include/llvm/Support/ValueHandle.h > llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp > > Modified: llvm/trunk/include/llvm/Support/ValueHandle.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ValueHandle.h?rev=161803&r1=161802&r2=161803&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Support/ValueHandle.h (original) > +++ llvm/trunk/include/llvm/Support/ValueHandle.h Mon Aug 13 18:06:54 2012 > @@ -110,11 +110,12 @@ > V != DenseMapInfo::getTombstoneKey(); > } > > -private: > +public: > // Callbacks made from Value. > static void ValueIsDeleted(Value *V); > static void ValueIsRAUWd(Value *Old, Value *New); > > +private: > // Internal implementation details. > ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); } > HandleBaseKind getKind() const { return PrevPair.getInt(); } > > Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=161803&r1=161802&r2=161803&view=diff > ============================================================================== > --- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original) > +++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Mon Aug 13 18:06:54 2012 > @@ -214,6 +214,11 @@ > else > V = GetValueInMiddleOfBlock(User->getParent()); > > + // Notify that users of the existing value that it is being replaced. > + Value *OldVal = U.get(); > + if (OldVal != V && OldVal->hasValueHandle()) > + ValueHandleBase::ValueIsRAUWd(OldVal, V); Calling a method named ValueIsRAUWd here seems a bit unintuitive: you're not replacing all the uses, just one of them. -Eli From stoklund at 2pi.dk Mon Aug 13 19:54:54 2012 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 13 Aug 2012 17:54:54 -0700 Subject: [llvm-commits] [llvm] r161769 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.cpp test/CodeGen/X86/vec_ss_load_fold.ll In-Reply-To: References: <20120813182942.30BA6352404C@llvm.org> Message-ID: <42B590EC-6FF4-4DB5-BA7D-680695A2BF43@2pi.dk> It should be simple to add test cases for the load folding. The si2... and ss2... cases are very different, and deserve separate tests. On Aug 13, 2012, at 5:42 PM, Craig Topper wrote: > I somewhat wonder if folding of scalar intrinsics works completely correctly. Those intrinsics have VR128 as their register class, but the load size is actually 32/64-bits. I think the folding code looks at the register class size to determine size. Adding Jakob for comment. > > ~Craig > > On Mon, Aug 13, 2012 at 11:29 AM, Manman Ren wrote: > Author: mren > Date: Mon Aug 13 13:29:41 2012 > New Revision: 161769 > > URL: http://llvm.org/viewvc/llvm-project?rev=161769&view=rev > Log: > X86: move Int_CVTSD2SSrr, Int_CVTSI2SSrr, Int_CVTSI2SDrr, Int_CVTSS2SDrr from > OpTbl1 to OpTbl2 since they have 3 operands and the last operand can be changed > to a memory operand. > > PR13576 > > Modified: > llvm/trunk/lib/Target/X86/X86InstrInfo.cpp > llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll > > Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=161769&r1=161768&r2=161769&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Mon Aug 13 13:29:41 2012 > @@ -414,12 +414,6 @@ > { X86::CVTSD2SIrr, X86::CVTSD2SIrm, 0 }, > { X86::CVTSS2SI64rr, X86::CVTSS2SI64rm, 0 }, > { X86::CVTSS2SIrr, X86::CVTSS2SIrm, 0 }, > - { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm, 0 }, > - { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm, 0 }, > - { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm, 0 }, > - { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm, 0 }, > - { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm, 0 }, > - { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm, 0 }, > { X86::CVTTPD2DQrr, X86::CVTTPD2DQrm, TB_ALIGN_16 }, > { X86::CVTTPS2DQrr, X86::CVTTPS2DQrm, TB_ALIGN_16 }, > { X86::Int_CVTTSD2SI64rr,X86::Int_CVTTSD2SI64rm, 0 }, > @@ -680,6 +674,12 @@ > { X86::IMUL64rr, X86::IMUL64rm, 0 }, > { X86::Int_CMPSDrr, X86::Int_CMPSDrm, 0 }, > { X86::Int_CMPSSrr, X86::Int_CMPSSrm, 0 }, > + { X86::Int_CVTSD2SSrr, X86::Int_CVTSD2SSrm, 0 }, > + { X86::Int_CVTSI2SD64rr,X86::Int_CVTSI2SD64rm, 0 }, > + { X86::Int_CVTSI2SDrr, X86::Int_CVTSI2SDrm, 0 }, > + { X86::Int_CVTSI2SS64rr,X86::Int_CVTSI2SS64rm, 0 }, > + { X86::Int_CVTSI2SSrr, X86::Int_CVTSI2SSrm, 0 }, > + { X86::Int_CVTSS2SDrr, X86::Int_CVTSS2SDrm, 0 }, > { X86::MAXPDrr, X86::MAXPDrm, TB_ALIGN_16 }, > { X86::MAXPDrr_Int, X86::MAXPDrm_Int, TB_ALIGN_16 }, > { X86::MAXPSrr, X86::MAXPSrm, TB_ALIGN_16 }, > > Modified: llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll?rev=161769&r1=161768&r2=161769&view=diff > ============================================================================== > --- llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll (original) > +++ llvm/trunk/test/CodeGen/X86/vec_ss_load_fold.ll Mon Aug 13 13:29:41 2012 > @@ -70,3 +70,17 @@ > ; CHECK: call > ; CHECK: roundss $4, %xmm{{.*}}, %xmm0 > } > + > +; PR13576 > +define <2 x double> @test5() nounwind uwtable readnone noinline { > +entry: > + %0 = tail call <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double> +4.569870e+02, double 1.233210e+02>, i32 128) nounwind readnone > + ret <2 x double> %0 > +; CHECK: test5: > +; CHECK: movl > +; CHECK: mov > +; CHECK: cvtsi2sd > +} > + > +declare <2 x double> @llvm.x86.sse2.cvtsi2sd(<2 x double>, i32) nounwind readnone > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > -- > ~Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/e8d55537/attachment.html From geek4civic at gmail.com Mon Aug 13 19:56:06 2012 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Tue, 14 Aug 2012 00:56:06 -0000 Subject: [llvm-commits] [llvm] r161825 - /llvm/trunk/test/CodeGen/ARM/floorf.ll Message-ID: <20120814005606.6DE23352404C@llvm.org> Author: chapuni Date: Mon Aug 13 19:56:06 2012 New Revision: 161825 URL: http://llvm.org/viewvc/llvm-project?rev=161825&view=rev Log: llvm/test/CodeGen/ARM/floorf.ll: Add explicit -mtriple=arm-unknown-unknown, or it fails on msvc. Modified: llvm/trunk/test/CodeGen/ARM/floorf.ll Modified: llvm/trunk/test/CodeGen/ARM/floorf.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/floorf.ll?rev=161825&r1=161824&r2=161825&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/floorf.ll (original) +++ llvm/trunk/test/CodeGen/ARM/floorf.ll Mon Aug 13 19:56:06 2012 @@ -1,4 +1,4 @@ -; RUN: llc -march=arm < %s | FileCheck %s +; RUN: llc -mtriple=arm-unknown-unknown < %s | FileCheck %s ; CHECK: test1 define float @test1() nounwind uwtable readnone ssp { From echristo at apple.com Mon Aug 13 20:09:10 2012 From: echristo at apple.com (Eric Christopher) Date: Tue, 14 Aug 2012 01:09:10 -0000 Subject: [llvm-commits] [llvm] r161826 - /llvm/trunk/lib/VMCore/Metadata.cpp Message-ID: <20120814010910.D23D3352404C@llvm.org> Author: echristo Date: Mon Aug 13 20:09:10 2012 New Revision: 161826 URL: http://llvm.org/viewvc/llvm-project?rev=161826&view=rev Log: Typo. Modified: llvm/trunk/lib/VMCore/Metadata.cpp Modified: llvm/trunk/lib/VMCore/Metadata.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=161826&r1=161825&r2=161826&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Metadata.cpp (original) +++ llvm/trunk/lib/VMCore/Metadata.cpp Mon Aug 13 20:09:10 2012 @@ -200,7 +200,7 @@ // destroy - Delete this node. Only when there are no uses. void MDNode::destroy() { setValueSubclassData(getSubclassDataFromValue() | DestroyFlag); - // Placement delete, the free the memory. + // Placement delete, then free the memory. this->~MDNode(); free(this); } From eli.friedman at gmail.com Mon Aug 13 20:46:46 2012 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 13 Aug 2012 18:46:46 -0700 Subject: [llvm-commits] [PATCH] Fix assertion failure with shufflevectors on ARM In-Reply-To: <1344865402.6429.16.camel@e102212-lin> References: <1344865402.6429.16.camel@e102212-lin> Message-ID: On Mon, Aug 13, 2012 at 6:43 AM, James Molloy wrote: > Hi, > > The attached patch fixes an assertion failure in the DAGCombiner. The > testcase is simply three shufflevectors. > > The DAGCombiner tries to optimise a BUILD_VECTOR by checking if it > consists purely of get_vector_elts from one or two source vectors. If > so, it either makes a concat_vectors node or a shufflevector node. > > However, it doesn't check the element type width of the underlying > vector, so if you have this sequence: > > [0] v4i16 = ... > [1] i32 = extract_vector_elt [0] > [2] i32 = extract_vector_elt [0] > [3] v16i8 = BUILD_VECTOR [1], [2], ... > > It will attempt to: > > [0] v4i16 = ... > [1] v16i8 = concat_vectors [0], ... > > Where this is actually invalid because the element width is completely > different. This causes an assertion failure down the line. > > My fix for this, I'm reasonably happy with. However the fix (bail out if > element width is incorrect) causes another bug further down the line. > > You have this code: > > [0] v4i16 = ... > [1] i16 = get_vector_elt [0] > [2] i8 = truncate [0] > [3] v16i8 = BUILD_VECTOR [2], ... > > It gets legalized (because vectors of i8 are not valid on ARM NEON), to > something like: > > [0] v4i16 = ... > [1] i16 = get_vector_elt [0] > [2] v16i8 = BUILD_VECTOR [1], ... > [3] i8 = truncate [0] > > Note that [3] is an orphan node. This orphan node is traversed in > LegalizeDAG() and causes an assertion failure because it is not legal. > > This is where my SelectionDAG-fu gets rusty. I believe it is due to > DAG.RemoveDeadNodes() not having fired, which should remove that node > completely and stop the combiner from attempting to legalize it. > > The patch attached does that simply by moving the call to > RemoveDeadNodes() inside its parent loop. > > I'm not convinced this is the neatest solution however - I'm convinced > there must be some reason why that orphan node isn't being removed at > the right place. But I don't know some of the internal contracts in > SelectionDAG too well, so I'm not sure. > > Could someone with more knowledge about SelectionDAG please look at > whether there is a contract being broken somewhere as opposed to a dead > node not being cleaned up quickly enough? There should be no nodes with illegal types upon entrance to LegalizeDAG, and LegalizeDAG should not be producing any nodes with illegal types. If shuffling around the call to RemoveDeadNodes somehow makes a node with an illegal type disappear, there's a bug elsewhere. -Eli From richard-llvm at metafoo.co.uk Mon Aug 13 21:56:52 2012 From: richard-llvm at metafoo.co.uk (Richard Smith) Date: Tue, 14 Aug 2012 02:56:52 -0000 Subject: [llvm-commits] [llvm] r161829 - /llvm/trunk/include/llvm/ADT/DenseMap.h Message-ID: <20120814025652.3B37A352404C@llvm.org> Author: rsmith Date: Mon Aug 13 21:56:51 2012 New Revision: 161829 URL: http://llvm.org/viewvc/llvm-project?rev=161829&view=rev Log: Avoid undefined behavior in DenseMap::shrink_and_clear(). Log2_32_Ceil(0) returns 32. This change mirrors the corresponding code in SmallDenseMap::shrink_and_clear(). Modified: llvm/trunk/include/llvm/ADT/DenseMap.h Modified: llvm/trunk/include/llvm/ADT/DenseMap.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=161829&r1=161828&r2=161829&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/DenseMap.h (original) +++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Aug 13 21:56:51 2012 @@ -617,8 +617,9 @@ this->destroyAll(); // Reduce the number of buckets. - unsigned NewNumBuckets - = std::max(64, 1 << (Log2_32_Ceil(OldNumEntries) + 1)); + unsigned NewNumBuckets = 0; + if (OldNumEntries) + NewNumBuckets = std::max(64, 1 << (Log2_32_Ceil(OldNumEntries) + 1)); if (NewNumBuckets == NumBuckets) { this->BaseT::initEmpty(); return; From rafael.espindola at gmail.com Mon Aug 13 22:05:42 2012 From: rafael.espindola at gmail.com (=?UTF-8?Q?Rafael_Esp=C3=ADndola?=) Date: Mon, 13 Aug 2012 23:05:42 -0400 Subject: [llvm-commits] [patch] Use the new edge dominance functions in GVN In-Reply-To: References: Message-ID: > In any case, an updated patch is attached. I made it slightly less > aggressive but faster by keeping isOnlyReachableViaThisEdge as a fast > dominance approximation. I understand that it is taking a technical > debt, but I think I should be able to repay it :-) Looking at the code of the new GVN pass I see that it implements a similar feature by doing AU.addRequiredID(BreakCriticalEdgesID) While this is a possibility, applying this to the current GVN implementation causes some problems. First, we have to mark BreakCriticalEdges as preserving AliasAnalysis and MemoryDependenceAnalysis, which I guess is fine. The addition of extra basic blocks seems to prevent some optimizations and causes two tests to fail: LLVM :: CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll LLVM :: Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.l I have not debugged exactly why. Finally, it seems that when looking at the time of a full opt -O2 run, at least with the current algorithm, the impact of splitting the critical edge is larger than the impact of directly reasoning about a use being dependent on an edge. In any case. I have attached both the previous patch and a variation that uses critical edge splitting instead. If there is a preference for the edge splitting one I can try to figure out the two remaining test failures. Cheers, Rafael -------------- next part -------------- A non-text attachment was scrubbed... Name: pr13307.patch Type: application/octet-stream Size: 13095 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/7e9ee788/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: pr13307-split.patch Type: application/octet-stream Size: 5345 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20120813/7e9ee788/attachment-0001.obj From mgottesman at apple.com Mon Aug 13 23:20:41 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:20:41 -0000 Subject: [llvm-commits] [LNT] r161833 - /lnt/trunk/lnt/server/ui/views.py Message-ID: <20120814042041.CA283352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:20:41 2012 New Revision: 161833 URL: http://llvm.org/viewvc/llvm-project?rev=161833&view=rev Log: [LNT] v4_global_status: Added code to handle field/revision arguments. A field argument is either 2 or 3. 2 is for compile time and 3 is for execution time. Revision is just an int as well. Modified: lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161833&r1=161832&r2=161833&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 23:20:41 2012 @@ -645,12 +645,15 @@ # Create a datetime for the day before the most recent run. yesterday = latest_date - datetime.timedelta(days=1) - - # Get the revision number for the default baseline and look up - # the fields we are interested in. - revision = ts.Machine.DEFAULT_BASELINE_REVISION - field = ts.Sample.get_primary_fields().next() - + + # Get arguments. + revision = int(request.args.get('revision', + ts.Machine.DEFAULT_BASELINE_REVISION)) + field = int(request.args.get('field', 2)) # 2 is for compile time + # FIXME: This maybe could be done in itertools or we could maybe + # return an actual list that is populated lazily. + field = [x for x in ts.Sample.get_primary_fields()][field-2] + # Get the list of all runs we might be interested in. recent_runs = ts.query(ts.Run).filter(ts.Run.start_time > yesterday).all() From mgottesman at apple.com Mon Aug 13 23:20:58 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:20:58 -0000 Subject: [llvm-commits] [LNT] r161838 - /lnt/trunk/lnt/server/ui/views.py Message-ID: <20120814042058.1BDE9352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:20:57 2012 New Revision: 161838 URL: http://llvm.org/viewvc/llvm-project?rev=161838&view=rev Log: [LNT] v4_global_status: Added current settings control panel. *NOTE* Baseline Type and Baseline Date in this commit are just set to None. I will put in support for those two features in a later commit. Modified: lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161838&r1=161837&r2=161838&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 23:20:57 2012 @@ -740,14 +740,20 @@ # Order the table by worst regression. test_table.sort(key = lambda row: row[1], reverse=True) - + + baselinetype = None + date = None + return render_template("v4_global_status.html", ts=ts, tests=test_table, machines=recent_machines, machine_groups_map=machine_groups_map, groups = list(grouping_set), - selected_field=field) + selected_field=field, + selected_baselinetype=baselinetype, + selected_revision=revision, + selected_date=date) @v4_route("/daily_report///") def v4_daily_report(year, month, day): From mgottesman at apple.com Mon Aug 13 23:21:24 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:21:24 -0000 Subject: [llvm-commits] [LNT] r161846 - in /lnt/trunk/lnt/server/ui: filters.py util.py Message-ID: <20120814042124.B6C50352404E@llvm.org> Author: mgottesman Date: Mon Aug 13 23:21:24 2012 New Revision: 161846 URL: http://llvm.org/viewvc/llvm-project?rev=161846&view=rev Log: [LNT] v4_global_status: Added code to filters.py/util.py so that arbitrary attributes can be added to the resultant rendered cell. This is done via an attribute dictionary. I would just remove the class/style arguments and just use attribute, but there is a lot of legacy code that uses it and this is not the commit to fix that. Modified: lnt/trunk/lnt/server/ui/filters.py lnt/trunk/lnt/server/ui/util.py Modified: lnt/trunk/lnt/server/ui/filters.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/filters.py?rev=161846&r1=161845&r2=161846&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/filters.py (original) +++ lnt/trunk/lnt/server/ui/filters.py Mon Aug 13 23:21:24 2012 @@ -9,9 +9,9 @@ ts = datetime.datetime.fromtimestamp(time) return ts.strftime('%Y-%m-%d %H:%M:%S %Z PST') -def filter_aspctcell(value, class_=None, style=None, *args, **kwargs): +def filter_aspctcell(value, class_=None, style=None, attributes=None, *args, **kwargs): cell = util.PctCell(value, *args, **kwargs) - return cell.render(class_, style) + return cell.render(class_, style, attributes) def filter_pprint(value): stream = StringIO.StringIO() Modified: lnt/trunk/lnt/server/ui/util.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/util.py?rev=161846&r1=161845&r2=161846&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/util.py (original) +++ lnt/trunk/lnt/server/ui/util.py Mon Aug 13 23:21:24 2012 @@ -208,12 +208,15 @@ for v in self.getColor()] return "#%02x%02x%02x" % (r,g,b) - def render(self, class_=None, style=None): + def render(self, class_=None, style=None, attributes=None): attrs = [] if style is not None: attrs.append('style="%s"' % (style,)) if class_ is not None: attrs.append('class="%s"' % (class_,)) + if attributes is not None: + for key, value in attributes.items(): + attrs.append('%s="%s"' % (key, value)) attrs.append('bgcolor="%s"' % (self.getColorString(),)) attr_string = ' '.join(attrs) return '' % (attr_string, self.getValue()) From mgottesman at apple.com Mon Aug 13 23:20:45 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:20:45 -0000 Subject: [llvm-commits] [LNT] r161834 - in /lnt/trunk/lnt/server/ui: static/v4_global_status.css templates/v4_global_status.html Message-ID: <20120814042045.694E0352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:20:45 2012 New Revision: 161834 URL: http://llvm.org/viewvc/llvm-project?rev=161834&view=rev Log: [LNT] v4_global_status.html: Added main control panel containers. These containers are: emperor-control, right-king-control, and left-king-control. This is a small commit so that I can add the actual control panels one at a time to make this whole commit process clearer for posterity. Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.css lnt/trunk/lnt/server/ui/templates/v4_global_status.html Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.css URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/v4_global_status.css?rev=161834&r1=161833&r2=161834&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/static/v4_global_status.css (original) +++ lnt/trunk/lnt/server/ui/static/v4_global_status.css Mon Aug 13 23:20:45 2012 @@ -1,4 +1,5 @@ +/* Table Styles. */ table#data-table tr { width: 100%; } @@ -45,3 +46,15 @@ text-align: left; overflow: hidden; } + +/* Main control panel container styles */ + +#emperor-control { + height: 35em; +} + +#right-king-control { + float: right; + margin: 0px; + padding: 0px; +} Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161834&r1=161833&r2=161834&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 23:20:45 2012 @@ -35,6 +35,14 @@ selected_field.name.replace("_", " ").title() }}{% endblock %} {% block body %} + +
+
+
+
+
+
+
Test Worst Time{{ m.name }}{{ m.name }}
Test Worst Time{{ m.name }}{{ m.name }}
%s
From mgottesman at apple.com Mon Aug 13 23:20:48 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:20:48 -0000 Subject: [llvm-commits] [LNT] r161835 - /lnt/trunk/lnt/server/ui/static/v4_global_status.css Message-ID: <20120814042048.9F796352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:20:48 2012 New Revision: 161835 URL: http://llvm.org/viewvc/llvm-project?rev=161835&view=rev Log: [LNT] v4_global_status: Added generic control panel styles. Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.css Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.css URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/v4_global_status.css?rev=161835&r1=161834&r2=161835&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/static/v4_global_status.css (original) +++ lnt/trunk/lnt/server/ui/static/v4_global_status.css Mon Aug 13 23:20:48 2012 @@ -1,5 +1,5 @@ -/* Table Styles. */ +/* Table Styles */ table#data-table tr { width: 100%; } @@ -8,7 +8,6 @@ outline: rgba(0, 0, 0, 0.3) solid 1px; } -/* Turn off text select */ table#data-table { -moz-user-select: none; -khtml-user-select: none; @@ -47,6 +46,37 @@ overflow: hidden; } +/* Generic control panel styles */ + +div.control-panel { + background-color: #cccccc; + border: solid 1px; + width: 35em; + margin-bottom: 0.5em; +} + +div.control-panel h3, +div.control-panel div { + margin-left: 1em; +} + +div.control-panel ul { + list-style-type: none; + margin: 0px; + padding: 0px; + margin-left: 1em; + margin-top: -0.25em; + margin-bottom: 1em; +} + + +div.control-panel table { + margin: 0px; + padding: 0px; + border: 0px; + margin-left: 1em; +} + /* Main control panel container styles */ #emperor-control { From mgottesman at apple.com Mon Aug 13 23:20:51 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:20:51 -0000 Subject: [llvm-commits] [LNT] r161836 - /lnt/trunk/lnt/server/ui/templates/v4_global_status.html Message-ID: <20120814042051.B0DEE352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:20:51 2012 New Revision: 161836 URL: http://llvm.org/viewvc/llvm-project?rev=161836&view=rev Log: [LNT] v4_global_status: Added machine control panel which allows you to selectively hide specific machines. *NOTE* This control panel is not wired up in this commit. Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161836&r1=161835&r2=161836&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 23:20:51 2012 @@ -40,6 +40,14 @@
+

Toggle Machine Visibility

+
+
    + {% for m in machines %} +
  • {{ m.name }}
  • + {% endfor %} +
+
From mgottesman at apple.com Mon Aug 13 23:20:55 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:20:55 -0000 Subject: [llvm-commits] [LNT] r161837 - /lnt/trunk/lnt/server/ui/templates/v4_global_status.html Message-ID: <20120814042055.0BFEF352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:20:54 2012 New Revision: 161837 URL: http://llvm.org/viewvc/llvm-project?rev=161837&view=rev Log: [LNT] v4_global_status: Added preconfigured data view control panel. *NOTE* This control panel is not completely wired up in this comment since I have not included any of the javascript yet. Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161837&r1=161836&r2=161837&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 23:20:54 2012 @@ -38,16 +38,72 @@
+

Current Settings

+
Test
+ + + + +
Comparison Field:{{ selected_field.name }}
Baseline Type:{{ selected_baseline_type }}
Baseline Revision:{{ selected_revision }}
Baseline Date:{{ selected_date }}
+

Select a New Comparison

+
+
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+
+
+

Toggle Machine Visibility

    {% for m in machines %} -
  • {{ m.name }}
  • +
  • {{ m.name }}
  • {% endfor %}
+

Preconfigured Data Views

+
+
    + {% for group in groups %} +
  • + {% endfor %} + +
  • +
+
From mgottesman at apple.com Mon Aug 13 23:21:01 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:21:01 -0000 Subject: [llvm-commits] [LNT] r161839 - in /lnt/trunk/lnt/server/ui: static/v4_global_status.css views.py Message-ID: <20120814042101.6906B352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:21:01 2012 New Revision: 161839 URL: http://llvm.org/viewvc/llvm-project?rev=161839&view=rev Log: [LNT] v4_global_status: Added revision control panel. Also made a few small fixes. *NOTE* This control panel is not completely wired up in this comment since I have not included any of the javascript yet. Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.css lnt/trunk/lnt/server/ui/views.py Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.css URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/v4_global_status.css?rev=161839&r1=161838&r2=161839&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/static/v4_global_status.css (original) +++ lnt/trunk/lnt/server/ui/static/v4_global_status.css Mon Aug 13 23:21:01 2012 @@ -88,3 +88,19 @@ margin: 0px; padding: 0px; } + +/* Revision control panel styles */ + +div#revision-control-panel { + height: auto; +} + +div#revision-control-panel label { + width: 30%; + display: block; +} + +div#revision-control-panel input.baseline-form { + width: 60%; + display: block; +} Modified: lnt/trunk/lnt/server/ui/views.py URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161839&r1=161838&r2=161839&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/views.py (original) +++ lnt/trunk/lnt/server/ui/views.py Mon Aug 13 23:21:01 2012 @@ -631,7 +631,8 @@ from lnt.server.ui import util ts = request.get_testsuite() - + fields = [f for f in ts.Sample.get_primary_fields()] + # Get the latest run. latest = ts.query(ts.Run.start_time).\ order_by(ts.Run.start_time.desc()).first() @@ -649,10 +650,7 @@ # Get arguments. revision = int(request.args.get('revision', ts.Machine.DEFAULT_BASELINE_REVISION)) - field = int(request.args.get('field', 2)) # 2 is for compile time - # FIXME: This maybe could be done in itertools or we could maybe - # return an actual list that is populated lazily. - field = [x for x in ts.Sample.get_primary_fields()][field-2] + field = fields[int(request.args.get('field', 2)) - 2] # 2 is for compile time # Get the list of all runs we might be interested in. recent_runs = ts.query(ts.Run).filter(ts.Run.start_time > yesterday).all() @@ -741,7 +739,8 @@ # Order the table by worst regression. test_table.sort(key = lambda row: row[1], reverse=True) - baselinetype = None + baseline_types = [] + baseline_type = None date = None return render_template("v4_global_status.html", @@ -750,8 +749,10 @@ machines=recent_machines, machine_groups_map=machine_groups_map, groups = list(grouping_set), + fields = fields, + baseline_types = baseline_types, selected_field=field, - selected_baselinetype=baselinetype, + selected_baseline_type=baseline_type, selected_revision=revision, selected_date=date) From mgottesman at apple.com Mon Aug 13 23:21:04 2012 From: mgottesman at apple.com (Michael Gottesman) Date: Tue, 14 Aug 2012 04:21:04 -0000 Subject: [llvm-commits] [LNT] r161840 - /lnt/trunk/lnt/server/ui/templates/v4_global_status.html Message-ID: <20120814042104.9BC3B352404C@llvm.org> Author: mgottesman Date: Mon Aug 13 23:21:04 2012 New Revision: 161840 URL: http://llvm.org/viewvc/llvm-project?rev=161840&view=rev Log: [LNT] v4_global_status: Added jquery includes to header. Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161840&r1=161839&r2=161840&view=diff ============================================================================== --- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original) +++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 23:21:04 2012 @@ -8,6 +8,21 @@ href="{{ url_for('.static', filename='v4_global_status.css') }}"> + + + + +