Displaying 20 results from an estimated 8000 matches similar to: "Source to Source"
2016 Feb 10
2
Modified LLVM IR
Hi,
My requirement is something like as given below,
a.c => a.obj contains a1() and a2() function
b.c => b.obj contains b1() and b2() function
main.c => main.obj call to a1, a2, b1, b2
Now, I want to move a1(), a2() from a.obj to b2.obj and on top of function
b1()
When I call b1() from main, it should call first a1, a2 and then function
definition of b1
Can you please give me some
2016 Feb 10
2
Modified LLVM IR
Hi,
Yes I am looking for IR pass that will do insert call of functions that
defined in another file.
Links/suggestions that guide me to start for adding IR pass will help me so
much.
Regards,
Deepika
On Wed, Feb 10, 2016 at 1:03 PM, mats petersson <mats at planetcatfish.com>
wrote:
> So how do you know what you want to modify (conceptually)?
>
> Have you got a IR pass that you
2016 Feb 09
2
[GVN] same sequence of instructions in if and else branch
and by "right thing" i mean it can hoist if you want and it can prove it
will not extend the live range.
Note that VBE (very busy expressions) is a code size optimization only. It
does not save time.
On Tue, Feb 9, 2016 at 12:26 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
> This GVN does not do that, this is correct. It is a very simple GVN. All
> phi nodes are
2015 Mar 31
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
> I think we can do such optimization with operator new, because new never returns null.
This is incorrect in the case of `new (std::nothrow) ...` - the whole
point of `(std::nothrow)` is to tell new that it should return NULL in
case of failure, rather than throw an exception (bad_alloc).
But the point here is not the actual return value, but the fact that
the compiler misses that the
2015 May 14
4
[LLVMdev] how to disable sse and avx
Thanks, Mats. Actually, it is able to generate the assembly now if I use
the follow command: clang++ -O3 -S -mllvm --x86-asm-syntax=intel -mno-sse
-o test_nosee.s test.cpp
However, when I use g++ -O3 -o test_nosse test_nosse.s -lm to generate the
executable, if gives me the following errors:
Error: too many memory references for `sub'
Error: too many memory references for `mov'
Error:
2016 Feb 16
4
[help] Kaleidoscope build fails after llvm-3.8
Hello ,
I have build llvm from release_38 branch ( only llvm and clang ) and
install it. My DYLD_LIBRARY_PATH points to installation-directory/lib.
I am compiling example files for Kaleidoscope with following command :
clang++ -g toy.cpp -std=c++11 `llvm-config --cxxflags --ldflags
--system-libs --libs core mcjit native` -O3 -o toy
but it fails with following error:
Undefined symbols for
2016 Feb 22
2
Transfer information IR to binary
I will try to explain better what I do.
The main goal behind this is to verify that a part of code is not modified by someone else (it is an integrity check).
To do this, I create in IR a function who take 2 parameters, a begin and an end value.
This function perform an hash over the code area (from begin to end) and return it.
At first, I don’t know the addresses and the hash value so I put
2017 Apr 21
2
Relocation design of different architecture
Thanks. I am just trying to find a relocation and linking design for
Hexagon architecture, whether to follow the MIPS style of relocation or
other architecture style of relocation. Thats my question . Thats why i was
asking about the functions and their differences Please guide.
Thanks,
Siddharth
On Fri, Apr 21, 2017 at 8:37 PM, mats petersson <mats at planetcatfish.com>
wrote:
> If
2015 Apr 01
2
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
Hi Mats,
I think Kevin's point is malloc can return 0, if malloc/free pair is
optimized way, the semantic of the original would be changed.
On the other hand, malloc/free are special functions, but programmers can
still define their own versions by not linking std library, so we must
assume malloc/free always have side-effect like other common functions,
unless we know we will link std
2016 Feb 22
2
Transfer information IR to binary
HI Mats,
> On 22 Feb 2016, at 16:48, mats petersson <mats at planetcatfish.com> wrote:
>
> And you want this for only SOME bits of code, and that's why you need to have the IR report what sections are "sensitive"?
Exactly and I want to chose this once the compilation is over.
> It would be fairly easy if the code you want to check is a normal functions, just
2017 Apr 21
2
Relocation design of different architecture
Thanks for reply, it was really helpful. Can u just be more specific and
tell about processRelocationRef() and resolveRelocation() in
Targets/RuntimeDyld(objectfile format)(arch).h and also in
RuntimeDyldELF.cpp and how the same function is implemented in different
ways in both the files ?
Thanks,
Siddharth
On Thu, Apr 20, 2017 at 8:16 PM, mats petersson <mats at planetcatfish.com>
wrote:
2016 Nov 16
2
Incorrect / missing dependencies in llvm build?
I sometimes see this with a clean build and most often it is 'Attributes.inc' that is missing. I usually have to 'touch Attributes.td' for this. But I don't know CMake well enough to know how to fix these issue properly.
MartinO
-----Original Message-----
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Jonathan Roelofs via llvm-dev
Sent: 16 November
2017 Apr 20
4
Relocation design of different architecture
Thanks for the reply. I was just asking about in general whatever header
files are there in Targets/ for different architectures are not including
any function except this processRelocationRef() to be used in
RuntimeDyldELF.cpp or RuntimeDyldCOFF.cpp or RuntimeDyldMachO.cpp and i
think these files are the ones which are actually doing the relocation and
linking work. So what purpose do these
2016 Nov 18
3
Linking LLVM IR with standard library
Hi,
I have a LLVM IR file generated for a different source language (Not C). I
have added a rand() function in it to generate random numbers.
I compiled the .ll file to .o using clang. However, when I execute the .o
file all generated numbers are zeros.
How should I link the .ll file with the standard library for the clang to
generate the random numbers?
Thanks
-Shilpa
-------------- next
2015 Apr 15
1
[LLVMdev] How to do bitcast for double to <2 x double>
So, you need to bitcast `pinst` to a pointer to Vector of double,
since it (I hope for your sake) is a pointer to integer. What you are
trying to do is bitcast a pointer into a vector, which probably will
lead to an assert or "bad code that doesn't work".
--
Mats
On 15 April 2015 at 21:57, zhi chen <zchenhn at gmail.com> wrote:
> What I want to do is to change the pInst
2016 Mar 20
2
Need help with code generation
Adding back the "all recipients" - sorry, sending message from my phone, I
forgot...
Since my runtime is for a Pascal compiler, it has to "adapt" the C startup
into a suitable Pascal environment. This means running the init portion of
other modules as well as discarding the argc, argv arguments. So, I have a
C main, which calls __PascalMain, which is the "main" for
2015 Apr 01
3
[LLVMdev] why we assume malloc() always returns a non-null pointer in instruction combing?
Hi David and Mats,
Thanks for your explanation. If my understanding is correct, it means we
don't need to consider the side-effect of malloc/free unless compiling with
-ffreestanding. Because without -ffreestanding, user defined malloc/free
should be compatible with std library. It makes sense to me.
My point is, in std library, malloc is allowed to return null if this
malloc failed. Why
2016 Nov 16
2
Incorrect / missing dependencies in llvm build?
+cbieneman
Mr. CMake might know how to fix it ;)
Jon
On 11/16/16 1:52 PM, mats petersson wrote:
> Thanks, at least I know I'm not imagining or doing something really
> daft! ;)
>
> My cmake skills are near 0%, so not sure I can fix, but perhaps I can
> at least raise a bug? ;)
>
> --
> Mats
>
> On 16 November 2016 at 20:28, Martin J. O'Riordan
>
2016 Mar 18
2
LLVM IR temporary variable reuse
For eg:
c=a-b is represented using the following statements in IR:
%tmp = load i32, i32* %a, align 4
%tmp1 = load i32, i32* %b, align 4
%sub = sub nsw i32 %tmp, %tmp1
store i32 %sub, i32* %c, align 4
whenever there is a redundant computation of the same, say k=a-b (if the
value of *a* and *b* are not changed) the code will be like this:
%tmp2 = load i32, i32* %a, align 4
%tmp3 =
2015 Jan 23
3
[LLVMdev] Behaviour of outs()?
I was just fixing a bug that was caused by `stdout` being closed
before the runtime has done `fflush(stdout)` [or however this is
implemented in the runtime].
The cause of this seems to be that `outs()` returns a static object
created from `raw_fd_stream(STDOUT_FILENO, true)` - the `true` being
the `shouldClose` parameter.
Surely LLVM is not supposed to close `stdout` as part of its operations?