Skip to content

Instantly share code, notes, and snippets.

View vtjnash's full-sized avatar

Jameson Nash vtjnash

View GitHub Profile
@vtjnash
vtjnash / japi1_vcat_52196.ll
Last active April 7, 2020 19:20
japi1_vcat_52196
define internal nonnull %jl_value_t addrspace(10)* @japi1_vcat_52196(%jl_value_t addrspace(10)*, %jl_value_t addrspace(10)**, i32) #8 !dbg !60493 {
top:
%3 = alloca %jl_value_t addrspace(10)*, i32 2
%gcframe = alloca %jl_value_t addrspace(10)*, i32 4, align 16
%4 = bitcast %jl_value_t addrspace(10)** %gcframe to i8*
call void @llvm.memset.p0i8.i32(i8* align 16 %4, i8 0, i32 32, i1 false), !tbaa !11893
%5 = alloca %jl_value_t addrspace(10)**, align 8
store volatile %jl_value_t addrspace(10)** %1, %jl_value_t addrspace(10)*** %5, align 8
%6 = load i64, i64* @jl_tls_offset.real, !tbaa !11895, !invariant.load !4
@vtjnash
vtjnash / prettyprint.asm
Created December 2, 2019 21:03
dwarf linetable pretty printer
julia> @code_native write(devnull, 'x')
.text
; ┌ @ io.jl:644 within `write'
; │┌ @ io.jl:644 within `bswap'
bswapl %edi
xorl %eax, %eax
nopw %cs:(%rax,%rax)
nop
; │└
; │ @ io.jl:648 within `write'
@vtjnash
vtjnash / after.ll
Last active April 28, 2019 00:58
bad TBAA/LICM
; *** IR Dump After Loop Invariant Code Motion *** (loop: %L140)
; ModuleID = 'reverse1'
source_filename = "reverse1"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64--linux-gnu"
%jl_value_t = type opaque
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (%jl_value_t addrspace(10)* (i8*, i32, i32)* @jl_gc_pool_alloc to i8*), i8* bitcast (%jl_value_t addrspace(10)* (i8*, i64)* @jl_gc_big_alloc to i8*)], section "llvm.metadata"
@vtjnash
vtjnash / print_to_string.ll
Last active April 27, 2019 20:33
X86AvoidStoreForwardingBlocks bug
; ModuleID = 'print_to_string_module.ll'
source_filename = "show"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:10:11:12:13"
target triple = "x86_64--linux-gnu"
%jl_value_t = type opaque
%jl_array_t = type { i8 addrspace(13)*, i64, i16, i16, i32 }
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (%jl_value_t addrspace(10)* (i8*, i32, i32)* @jl_gc_pool_alloc to i8*), i8* bitcast (%jl_value_t addrspace(10)* (i8*, i64)* @jl_gc_big_alloc to i8*)], section "llvm.metadata"
@vtjnash
vtjnash / VNpatch2.diff
Created February 22, 2019 18:13
some likely looking GVN bugs
diff -rpu llvm-6.0.0.src/lib/Transforms/Scalar/GVN.cpp llvm-6.0.0-VNpatch2/lib/Transforms/Scalar/GVN.cpp
--- llvm-6.0.0.src/lib/Transforms/Scalar/GVN.cpp 2017-12-08 19:21:41.000000000 -0500
+++ llvm-6.0.0-VNpatch2/lib/Transforms/Scalar/GVN.cpp 2018-07-19 16:35:26.000000000 -0400
@@ -871,6 +871,10 @@ bool GVN::AnalyzeLoadAvailability(LoadIn
// read by the load, we can extract the bits we need for the load from the
// stored value.
if (StoreInst *DepSI = dyn_cast<StoreInst>(DepInfo.getInst())) {
+ if (DepSI->getValueOperand()->getType() != LI->getType() &&
+ !canCoerceMustAliasedValueToLoad(DepSI->getValueOperand(),
+ LI->getType(), DL))
@vtjnash
vtjnash / openblas 0.3.5
Created January 8, 2019 19:22
openblas 0.3.5 test failures
Test Summary: | Pass Fail Total
Overall | 69682 645 70327
LinearAlgebra/hessenberg | 40 40
LinearAlgebra/givens | 1840 1840
LinearAlgebra/pinv | 264 24 288
LinearAlgebra/structuredbroadcast | 408 408
LinearAlgebra/uniformscaling | 354 354
LinearAlgebra/generic | 434 434
LinearAlgebra/schur | 390 390
LinearAlgebra/adjtrans | 253 253
@vtjnash
vtjnash / pcre-handle-ill-formed-utf8.diff
Created June 20, 2018 21:05
Patch to PCRE2 to handle ill-formed UTF8 data (assuming it is safe to skip the length check)
diff -prU12 pcre2-10.30-release/src/pcre2_internal.h pcre2-10.30/src/pcre2_internal.h
--- pcre2-10.30-release/src/pcre2_internal.h 2017-07-19 12:00:20.000000000 -0400
+++ pcre2-10.30/src/pcre2_internal.h 2018-06-20 17:03:09.000000000 -0400
@@ -271,103 +271,157 @@ is not supported. */
/* The following macros were originally written in the form of loops that used
data from the tables whose names start with PRIV(utf8_table). They were
rewritten by a user so as not to use loops, because in some environments this
gives a significant performance advantage, and it seems never to do any harm.
*/
a020a44e72 112143378 bytes ############# Merge pull request #25655 from JuliaLang
3f34c629e1 112221811 bytes ############# Replace the --machinefile to --machine-f
a0fe64cde1 112154555 bytes ############# Merge pull request #25578 from JuliaLang
bca94e4bd5 0 bytes Merge pull request #25698 from fredrikek
dcb0517b22 0 bytes Merge pull request #25622 from JuliaLang
1888eb67f7 111775845 bytes ############ Merge pull request #23724 from invenia/a
6aae4d5b3f 112000185 bytes ############# Merge pull request #25644 from fredrikek
f7b1033464 111820037 bytes ############ Update julia version number in README.md
56c5075f8f 112699665 bytes ############### open: deprecate positional flags for key
5d6dc89826 112467897 bytes ############## remove testgroups moved to stdlib (#2560
9f41f148c5 89575738 bytes ####################### Eliminate full from test/math.jl and test/linalg/uniformscal
8c07a51de7 89172946 bytes ###################### Eliminate full from test/linalg/[dense|diagonal.jl]. (#23890
d31010ac1b 0 bytes FAILED Eliminate full from test/linalg/cholesky.jl. (#23891)
c240439eca 89152138 bytes ###################### Eliminate full from test/linalg/special.jl. (#23895)
ed51793c7e 89161862 bytes ###################### Eliminate uses of full from test/sparse/[spqr|cholmod|sparse
d7e7d313f9 0 bytes FAILED Merge pull request #23892 from JuliaLang/yyc/codegen/phi-uni
b3dc531383 89591122 bytes ####################### Merge pull request #23883 from JuliaLang/jn/fix-static-align
aee64e3528 89581242 bytes ####################### eliminate full from test/linalg/symmetric.jl (#23896)
b72af507df 89171090 bytes ###################### Merge pull request #23894 from JuliaLang/yyc/tests/llvm40
91b75cd859 89605094 bytes ##########
# goal: compute [Nullable(x ^ 2 + x) for x in filter!(isodd, data)]
# using the following syntax:
data |>
(+filter!)( isodd ) |>
(+map)( x -> x^2 ) |>
(2 + map)((x, y) -> (x + y), data)
import Base: +
# masochistic oneliner
+(f) = ((g, args...) -> (arg -> f((arg -> isnull(arg) ? arg : g(arg)), arg, args...)))