Skip to content

Instantly share code, notes, and snippets.

View jmorse's full-sized avatar

Jeremy Morse jmorse

View GitHub Profile
target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-w64-windows-gnu"
define fastcc ptr @PyVectorcall_Function(i1 %cmp.i) {
entry:
%conv.i = zext i1 %cmp.i to i32
%tobool.not = icmp eq i32 %conv.i, 0
br i1 %tobool.not, label %cleanup, label %if.end
if.end: ; preds = %entry
struct foo {
int bar;
int baz;
int qux;
};
int quux(int a, int b, int c) {
struct foo xyzzy = {0, 0, 0};
xyzzy.bar += a;
xyzzy.baz += b;
@jmorse
jmorse / gist:bb283cd69b351a8ad568f26a50c5553c
Created January 21, 2021 13:06
Stack trace for llvm D94976
#0 llvm::DwarfUnit::getOrCreateSubprogramDIE (this=0x8aa6050, SP=0x8a62cc0,
Minimal=false)
at /fast/fs/llvm4/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:1096
#1 0x0000000005f08a14 in llvm::DwarfUnit::getOrCreateContextDIE (
this=0x8aa6050, Context=0x8a62cc0)
at /fast/fs/llvm4/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:525
#2 0x0000000005f08b75 in llvm::DwarfUnit::getOrCreateTypeDIE (this=0x8aa6050,
TyNode=0x8a67d78)
at /fast/fs/llvm4/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp:597
#3 0x0000000005f0890e in llvm::DwarfUnit::addType (this=0x8aa6050,
; ModuleID = 'test.cpp'
source_filename = "test.cpp"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%_Z3foov.Frame = type { void (%_Z3foov.Frame*)*, void (%_Z3foov.Frame*)*, %"struct.coro::promise_type", i2, %"struct.std::experimental::coroutines_v1::suspend_never", %"struct.std::experimental::coroutines_v1::suspend_always", i32, %"class.std::experimental::coroutines_v1::coroutine_handle.0", [10 x i32], %"class.std::experimental::coroutines_v1::coroutine_handle", %"class.std::experimental::coroutines_v1::coroutine_handle.0", %"class.std::experimental::coroutines_v1::coroutine_handle", %"class.std::experimental::coroutines_v1::coroutine_handle.0", %"class.std::experimental::coroutines_v1::coroutine_handle", %"struct.std::experimental::coroutines_v1::suspend_never" }
%"struct.coro::promise_type" = type { i8 }
%"struct.std::experimental::coroutines_v1::suspend_always" = type { i8 }
%"class.std::experimental::coroutines_v1::
@jmorse
jmorse / gist:a14763d935ef5d20e6e5dc41672c734a
Created September 28, 2020 10:08
Various clang-3.4 locstat blobs
Location statistics for clang-3.4 RelWtihDebInfo build with d3af441dfeb69d4c and entry value emission disabled,
=================================================
Debug Location Statistics
=================================================
cov% samples percentage(~)
-------------------------------------------------
0% 872230 25%
(0%,10%) 48622 1%
[10%,20%) 50512 1%
[20%,30%) 57409 1%
@jmorse
jmorse / gist:bbab447ef6e8f9f596fbceabf188cf1e
Created August 28, 2020 13:00
MIR after register coalescing
body: |
bb.0.entry:
successors: %bb.1(0x80000000)
%7:gr64 = IMPLICIT_DEF
bb.1.for.body.i.i.i.i:
successors: %bb.3(0x30000000), %bb.2(0x50000000)
%1:gr64 = MOV64rm %7, 1, $noreg, 0, $noreg :: (load 8 from %ir.__first.addr.04.i.i.i.i1)
@jmorse
jmorse / gist:c45d7f9d5e328018ca884fda6bbde15c
Created August 28, 2020 12:59
MIR before register coalescing
body: |
bb.0.entry:
successors: %bb.1(0x80000000)
%7:gr64 = IMPLICIT_DEF
bb.1.for.body.i.i.i.i:
successors: %bb.3(0x30000000), %bb.2(0x50000000)
%0:gr64 = COPY killed %7
@jmorse
jmorse / gist:3d9972e91cdf94b093f14501a4d14829
Created August 28, 2020 12:59
MIR before phi node elimination
body: |
bb.0.entry:
successors: %bb.1(0x80000000)
bb.1.for.body.i.i.i.i:
successors: %bb.3(0x30000000), %bb.2(0x50000000)
%0:gr64 = PHI undef %5:gr64, %bb.0, %3, %bb.3
%1:gr64 = MOV64rm %0, 1, $noreg, 0, $noreg :: (load 8 from %ir.__first.addr.04.i.i.i.i1)
@jmorse
jmorse / gist:4b80df44d5f96ab9ed917d10f625128e
Created August 28, 2020 12:57
IR for coalescing-muckup example
; ModuleID = './extracted.ll'
source_filename = "/fast/fs/llvm3/llvm/lib/TableGen/Error.cpp"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%"class.llvm::SourceMgr" = type { %"class.std::vector", %"class.std::vector.2", void (%"class.llvm::SMDiagnostic"*, i8*)*, i8* }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<llvm::SourceMgr::SrcBuffer, std::allocator<llvm::SourceMgr::SrcBuffer>>::_Vector_impl" }
%"struct.std::_Vector_base<llvm::SourceMgr::SrcBuffer, std::allocator<llvm::SourceMgr::SrcBuffer>>::_Vector_impl" = type { %"struct.llvm::SourceMgr::SrcBuffer"*, %"struct.llvm::SourceMgr::SrcBuffer"*, %"struct.llvm::SourceMgr::SrcBuffer"* }
%"struct.llvm::SourceMgr::SrcBuffer" = type { %"class.std::unique_ptr", i8*, %"class.llvm::SMLoc" }
--- |
; RUN: llc %s -march=x86-64 -run-pass=livedebugvalues -o - -experimental-debug-variable-locations | FileCheck %s -implicit-check-not=DBG_VALUE
define i32 @_Z8bb_to_bb() local_unnamed_addr !dbg !12 {
entry:
br label %bb1, !dbg !17
bb1:
br label %bb2, !dbg !17
bb2:
br label %bb3, !dbg !17