Skip to content

Instantly share code, notes, and snippets.

static Type *getIRTypeFromMachineType(MVT VT, LLVMContext &Ctx) {
assert(!VT.isScalableVector() && "Not prepared to deal with scalables.");
if (VT.isVector())
return VectorType::get(
getIRTypeFromMachineType(VT.getVectorElementType(), Ctx),
VT.getVectorElementCount());
if (VT.isInteger())
@LebedevRI
LebedevRI / googlebenchmark-state_assembly_test-new.ll
Created May 11, 2019 16:31
googlebenchmark-state_assembly_test llvm
; ModuleID = '../test/state_assembly_test.cc'
source_filename = "../test/state_assembly_test.cc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%"class.benchmark::State" = type { i64, i64, i64, i8, i8, i8, %"class.std::vector", i64, i64, i64, %"class.std::map", i32, i32, %"class.benchmark::internal::ThreadTimer"*, %"class.benchmark::internal::ThreadManager"* }
%"class.std::vector" = type { %"struct.std::Vector_base" }
%"struct.std::Vector_base" = type { %"struct.std::Vector_base<long, std::allocator<long> >::Vector_impl" }
%"struct.std::Vector_base<long, std::allocator<long> >::Vector_impl" = type { i64*, i64*, i64* }
%"class.std::map" = type { %"class.std::Rb_tree" }
cmake_minimum_required (VERSION 2.8.12)
project (test CXX C)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
add_executable(zzzzzz zzzzzz.cc)
target_link_libraries(zzzzzz Threads::Threads)
class FunctionASTVisitor : public RecursiveASTVisitor<FunctionASTVisitor> {
using Base = RecursiveASTVisitor<FunctionASTVisitor>;
public:
bool VisitOMPExecDir(OMPExecDir *D) {
OmpStructuredStmts.emplace_back(D.getStructuredStmt());
}
bool VisitSOMETHINGELSE(???) {
if(InOmpStructuredStmt)
@LebedevRI
LebedevRI / combineLowHighPass.ll
Last active January 4, 2019 07:52
rawspeed VC5Decompressor wavelet vectorization
; ModuleID = '/tmp/full.ll'
source_filename = "/home/lebedevri/rawspeed/src/librawspeed/decompressors/VC5Decompressor.cpp"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.ident_t = type { i32, i32, i32, i32, i8* }
%"class.rawspeed::VC5Decompressor::Wavelet" = type <{ i32, i32, i16, [6 x i8], %"struct.std::array", i32, [4 x i8] }>
%"struct.std::array" = type { [4 x %"class.std::unique_ptr"] }
%"class.std::unique_ptr" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
@LebedevRI
LebedevRI / comparison
Last active June 16, 2018 18:16
googlebench noise?
$ ~/src/googlebenchmark/tools/compare.py -u benchmarks /tmp/run{0,1}.json
Comparing /tmp/run0.json to /tmp/run1.json
Benchmark Time CPU Time Old Time New CPU Old CPU New
---------------------------------------------------------------------------------------------------------------------------------
./_T012014.RW2/threads:8/real_time +0.0273 +0.0770 45 47 10 10
./_T012014.RW2/threads:8/real_time +0.0114 +0.0756 46 47 10 10
./_T012014.RW2/threads:8/real_time +0.0129 +0.0806 46 47 10 10
./_T012014.RW2/threads:8/real_time +0.0246 +0.0748 46 47 10 10
./_T012014.RW2/threads:8/real_time +0.0312 +0.0758 45 47 10
This file has been truncated, but you can view the full file.
./src/CMakeFiles/rawspeed.dir/librawspeed/decompressors/SonyArw2Decompressor.cpp.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <rawspeed::SonyArw2Decompressor::SonyArw2Decompressor(rawspeed::RawImage const&, rawspeed::ByteStream const&)>:
SonyArw2Decompressor():
/home/lebedevri/rawspeed/build-Clang-SANITIZE/../src/librawspeed/decompressors/SonyArw2Decompressor.cpp:36
This file has been truncated, but you can view the full file.
./src/CMakeFiles/rawspeed.dir/librawspeed/decompressors/SonyArw2Decompressor.cpp.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <rawspeed::SonyArw2Decompressor::SonyArw2Decompressor(rawspeed::RawImage const&, rawspeed::ByteStream const&)>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 41 57 push %r15
#include <cassert>
#include <cstdlib>
#include <cstring>
using ushort16 = unsigned short;
class PentaxDecompressor {
enum class ThreadingModel {
// no threading whatsoever, need to do everything right here and now.
NoThreading = 0,
@LebedevRI
LebedevRI / rawspeed.c
Created August 10, 2017 11:14
some strange llvm miscompile?
#include <assert.h>
int main () {
unsigned short dest[128];
int pred[2];
pred[0] = dest[0];
pred[1] = dest[1];