Coder Social home page Coder Social logo

a2flo / floor_llvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from llvm/llvm-project

6.0 6.0 1.0 1.16 GB

modified clang/LLVM/libc++ toolchain providing same-source CUDA/Host/Metal/OpenCL/Vulkan programming used by libfloor (https://github.com/a2flo/floor)

Home Page: http://llvm.org

CMake 0.30% C++ 43.64% Assembly 8.43% C 12.98% Python 1.07% LLVM 32.65% Shell 0.03% Dockerfile 0.01% CSS 0.01% JavaScript 0.01% Emacs Lisp 0.01% Batchfile 0.01% Objective-C 0.48% Objective-C++ 0.10% HTML 0.19% Cuda 0.09% Pawn 0.01% SWIG 0.01% Rust 0.01% M 0.01%

floor_llvm's People

Contributors

akyrtzi avatar arsenm avatar chandlerc avatar chapuni avatar d0k avatar ddunbar avatar douggregor avatar dwblaikie avatar echristo avatar eefriedman avatar ericwf avatar espindola avatar isanbard avatar jdevlieghere avatar labath avatar lattner avatar lebedevri avatar lhames avatar maskray avatar nico avatar resistor avatar rksimon avatar rnk avatar rotateright avatar rui314 avatar stoklund avatar tkremenek avatar tobiasgrosser avatar topperc avatar zygoloid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gzorin

floor_llvm's Issues

Replacing `freeze` with `bitcast` does not work for aggregate inputs

The LLVM 5.0 bitcode writer in here currently replaces freeze with bitcast when writing out the IR:

case Instruction::Freeze: {
// freeze instruction is not supported by LLVM 5.0,
// but we can more or less emulate it as an identity function
// -> encode as a bitcast to the same type
auto Operand = I.getOperand(0);
Code = bitc::FUNC_CODE_INST_CAST;
if (!pushValueAndType(Operand, InstID, Vals))
AbbrevToUse = FUNCTION_INST_CAST_ABBREV;
Vals.push_back(VE.getTypeID(Operand->getType()));
Vals.push_back(getEncodedCastOpcode(Instruction::BitCast));
break;
}

We noticed with Julia/Metal.jl that this approach is not legal. From the langref:

The ‘bitcast’ instruction takes a value to cast, which must be a non-aggregate first class value, and a type to cast it to, which must also be a non-aggregate first class type.

We switched to running some IR rewrite passes before invoking the bitcode writer, simply replacing the freeze by its operands: JuliaGPU@9c518c4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.