search for: frasercrmck

Displaying 20 results from an estimated 20 matches for "frasercrmck".

2016 Oct 10
8
Generate Register Indirect mode instruction
Hi All, I am new to llvm backend. I am trying out few examples to understand backend codegen. I have ported llvm LEG @ https://github.com/frasercrmck/llvm-leg to llvm 3.9 successfully. Currently, the LEG instructions are RISC load-store type instruction. I want to generate some instructions for register indirect mode, like following: IR: @a = local_unnamed_addr global i32 0, align 4 @b = local_unnamed_addr global i32 0, align 4 @c = local_unn...
2020 Jul 14
2
[Beginner] Understanding Tablegen language
...%20an%20LLVM%20backend-720.mov http://llvm.org/devmtg/2014-10/#tutorial1 http://www.inf.ed.ac.uk/teaching/courses/ct/other/LLVMBackend-2015-03-26_v2.pdf llvm-leg: LEG Example Backend LEG Example Backend: a simple example LLVM backend for an ARM-like architecture: 'LEG'. https://github.com/frasercrmck/llvm-leg Best, Matt
2012 Mar 12
0
[LLVMdev] LLI Segfaulting
Yes, that is what I mean. :-) On Mar 12, 2012 11:02 AM, "Fraser Cormack" <frasercrmck at gmail.com> wrote: > > Hi Gavin, > > Do you mean something along the lines of having my array struct as { i32, > i32* } and then indexing it with a gep and allocating the appropriate > memory > when I learn of it? > > Thanks, > Fraser > > > Gavin Harriso...
2012 Mar 12
1
[LLVMdev] LLI Segfaulting
...happen when the function returns, wouldn't the new array allocation portion go out of scope, as it's allocated on the function's stack frame? Thanks, Fraser Gavin Harrison-2 wrote: > > Yes, that is what I mean. :-) > On Mar 12, 2012 11:02 AM, "Fraser Cormack" <frasercrmck at gmail.com> wrote: > >> >> Hi Gavin, >> >> Do you mean something along the lines of having my array struct as { i32, >> i32* } and then indexing it with a gep and allocating the appropriate >> memory >> when I learn of it? >> >> Thanks,...
2012 Mar 12
2
[LLVMdev] LLI Segfaulting
Hi Gavin, Do you mean something along the lines of having my array struct as { i32, i32* } and then indexing it with a gep and allocating the appropriate memory when I learn of it? Thanks, Fraser Gavin Harrison-2 wrote: > > Hi Fraser, > > Is there anything preventing you from using a pointer for the second part > of the structure and allocating memory for it later? > >
2012 Feb 22
1
[LLVMdev] Size of structs & arrays
Eli Friedman-2 wrote: > > > Try llvm::Constant::getNullValue(). > > I'm trying this: llvm::Constant* one = llvm::Constant::getNullValue(llvm::IntegerType::get(mod->getContext(), 64)); llvm::ConstantInt* two = llvm::ConstantInt::get(mod->getContext(), llvm::APInt(32, llvm::StringRef("1"), 10)); std::vector<llvm::Value*> indices;
2012 Oct 04
1
[LLVMdev] RegisterClass constraints in TableGen
Hi, I've come across a problem while working on an LLVM backend for a new target architecture. This architecture has two single-ported register files. Each instruction can only read one operand from each register file, but can write to either. I tried implementing it naïvely in TableGen with two definitions per instruction, so I had: def AllRegs : RegisterClass< ... (add interleave
2020 Jul 15
2
[Beginner] Understanding Tablegen language
.../#tutorial1 >> >> http://www.inf.ed.ac.uk/teaching/courses/ct/other/LLVMBackend-2015-03-26_v2.pdf >> >> llvm-leg: LEG Example Backend >> LEG Example Backend: a simple example LLVM backend for an ARM-like >> architecture: 'LEG'. >> https://github.com/frasercrmck/llvm-leg >> >> Best, >> Matt >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200715/c2e3a805/attachment-0001.html>
2012 Feb 22
0
[LLVMdev] Size of structs & arrays
On Wed, Feb 22, 2012 at 1:56 PM, Fraser Cormack <frasercrmck at gmail.com> wrote: > > I'm trying to work out the size of a struct so that I can pass this to the > 'llvm.memcpy' intrinsic. It's easy to find out how I'm supposed to do this, > as I keep seeing the following: > > %Size = getelementptr %T* null, int 1 >...
2016 Aug 28
2
Basic Backend: Load Indirect
...CPU with a very small instruction set of only 24 instructions called PROL16 is used to teach CPU architecture and chip design. I currently try to create a LLVM backend support for the PROL16 as part of a compiler example for my professor. I started to use your LEG CPU framework(https://github.com/frasercrmck/llvm-leg/blob/master/lib/Target/LEG/) as base for the PROL16 as it is much simpler than the CPU0. I put some time into implementing the Load/Store from/to Memory instruction. In difference to the LEG Load/Store or most other CPUs, the PROL16 does not support an indirect memory load with an immediat...
2012 Feb 22
5
[LLVMdev] Size of structs & arrays
I'm trying to work out the size of a struct so that I can pass this to the 'llvm.memcpy' intrinsic. It's easy to find out how I'm supposed to do this, as I keep seeing the following: %Size = getelementptr %T* null, int 1 %SizeI = cast %T* %Size to uint But I'm unsure how I actually do this in the C++ API. Is the 'null' here a llvm::ConstantPointerNull? Any help
2020 Jul 13
2
[Beginner] Understanding Tablegen language
Hi, I am new to LLVM and I find TableGen language really cryptic. The reference manual to the language is not helpful either. I can look at the existing .td file and reverse engineer but I am looking for a detailed manual. Specifically, I have below questions: 1. What is a basic syntax for writing a dag? From the lang ref manual I can see that its something like operator followed by ArgList which
2012 Feb 03
2
[LLVMdev] Invalid bitcode signature
I'm trying to link two modules together using the C++ API, one that's a sort of library module and one that's being generated from the source language. If I have something like this: OwningPtr<MemoryBuffer> owning_ptr; if (MemoryBuffer::getFile(StringRef("../hello.bc"), owning_ptr)) std::cout << "error opening file" << std::endl; Module* Lib
2012 Feb 04
2
[LLVMdev] Invalid bitcode signature
Bill Wendling-3 wrote: > > The error is coming from the bit-code reader. Make sure that you generated > the file with '-emit-llvm' (i.e., it's not an object file) and that it's > the binary version of the bit-code file, not the text version. > > And, llvm-gcc? really? :-) > > Is there no way that the API can generate valid bitcode? And no, not really
2012 Feb 12
1
[LLVMdev] Invalid bitcode signature
Oh, and upgrading hasn't actually fully worked, I'm still getting cases where it's not merging the two structs from each module properly. This, coupled with my issue of segfaulting when accessing a struct field that I know will exist once modules are linked, is causing me a bit of a headache. How do other people get around this? Thanks, Fraser Chris Lattner-2 wrote: > >
2012 Oct 11
0
[LLVMdev] RegisterClass constraints in TableGen
Excellent, I've implemented my own PBQP register allocator and solved the issue very painlessly. Now onto those more interesting problems! Thanks for your suggestion, Fraser On Fri, Oct 5, 2012 at 9:26 AM, Gergö Barany <gergo at complang.tuwien.ac.at>wrote: > On Thu, Oct 04, 2012 at 16:20:53 +0100, Fraser Cormack wrote: > > This architecture has two single-ported register
2012 Feb 23
1
[LLVMdev] Size of structs & arrays
Eli Friedman-2 wrote: > > > Try llvm::Constant::getNullValue(). > > Thanks, that's working nicely (so far). Eli Friedman-2 wrote: > > > Yes; [0 x i32] isn't really a variable-length array, just a > placeholder for an array of unknown size. You have to track the size > yourself. > > This is working, too, however I'm getting a segmentation
2012 Mar 12
2
[LLVMdev] LLI Segfaulting
Hi, I've been stuck with this problem for a while now, and my supervisor's starting to think it's a bug in lli, but I thought I'd ask here before going down that route. I have this code, which stores an array in my 'MainClass', and prints out an element of it. Note that the print statement is irrelevant here, it segfaults regardless, and this code has been run with -O2
2012 Mar 12
2
[LLVMdev] LLI Segfaulting
Hi Duncan, Duncan Sands wrote: > > Hi Fraser, it looks to me like you are smashing the stack. > >> define void @main() nounwind { >> allocas: >> %0 = alloca { i32, [0 x i32] }, align 8 > > ^ this allocates 4 bytes on the stack. > >> %2 = getelementptr inbounds { i32, [0 x i32] }* %0, i64 0, i32 1 > > ^ this gets a pointer to the byte
2012 Feb 07
3
[LLVMdev] Invalid bitcode signature
Sorry, I was being an idiot and was trying to link the wrong file type. Sigh. Now I have a problem where I merge two modules each containing the same struct, one opaque and one defined, and it's not merging the two consistently. I have two, let's say %"StructA" = type opaque %"StructB" = type opaque in one module, and in the other: %"StructA" = type { i8 }