Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] Removing unused global constant"
2017 Oct 25
3
LLVM v6.0 Internalize and GlobalDCE PASS can not work together?
Hi LLVM developers,
$ cat hello.c
#include <stdio.h>
void foo() {
}
int main(int argc, char *argv[]) {
for (int i = 0; i < 10; i++) {
printf("%d\n", i);
}
return 0;
}
$ /opt/llvm-svn/bin/clang --version
Fedora clang version 6.0.0 (trunk 316308) (based on LLVM 6.0.0svn)
Target: x86_64-redhat-linux
Thread model: posix
InstalledDir: /opt/llvm-svn/bin
$
2017 Oct 26
2
LLVM v6.0 Internalize and GlobalDCE PASS can not work together?
Hi Hal,
Thanks for your hint!
$ /opt/llvm-svn/bin/opt -S -internalize
-internalize-public-api-list=main -globaldce hello3.ll -o
hello3.dce.ll it works :)
But I argue that `main` Function should be inserted into ExternalNames
by default:
Index: lib/Transforms/IPO/Internalize.cpp
===================================================================
--- lib/Transforms/IPO/Internalize.cpp
2013 Oct 24
2
[LLVMdev] LLVM use chains
Hi,
I have:
...
@.str1 = private unnamed_addr constant [21 x i8] c"Now f is a
function\0A\00", align 1
; Function Attrs: ssp uwtable
define i32 @_Z1fv() #2 {
entry:
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([21
x i8]* @.str1, i32 0, i32 0))
ret i32 0
}
Then I get after trying to erase the function from the module:
511
2007 Jun 06
1
add inverse recursive feature or do a mkdir -p/install -D -d ?
Hi,
Background :
I am using rsync to push/sync FTP uploaded files from master server
to slave servers. On slaves the full directory path of each file doesn't
exist so rsync is unable to sync it and there a no options in rsync to do
something like "mkdir -p/install -D -d" on destination before sync file.
N.B. I don't want to do a full sync of the root/home directory every time
a
2012 Apr 10
0
[LLVMdev] How to explain this weird phenomenon????????
Hi, my friends
I finally insert the callInst into the hello.bc file.Then I compile the hello.bc to hello.o file and the check.c to check.o file. And I think by link those to .o file togetherI can get the executable ELF file(clang hello.o check.o -o finalfile).
But when I link the two objective file, it said
"hello.o: In function `main':
hello.bc:(.text+0x69): undefined reference to
2014 Jul 10
2
[LLVMdev] Telling the optimizer a value is always null at the start
How do I tell the optimizer that the (dereferenced) value of an i8**
parameter is NULL at the start so that it can eliminate the check?
I have code like:
void test2(void** ex) {
printf("go\n"); // does not change *ex
}
void call2(void** ex);
void testeh(void** ex) {
// I want to tell the optimizer *ex is null so it can eliminate the
first
2012 Apr 10
1
[LLVMdev] How to explain this weird phenomenon????????
Your files do not appear to implement the check() function.
On Tue, Apr 10, 2012 at 4:57 PM, 15102925731 <zhenkaixd at 126.com> wrote:
> Hi, my friends
>
> I finally insert the callInst into the hello.bc file.Then I compile the
> hello.bc to hello.o file and the check.c to check.o file. And I think by
> link those to .o file togetherI can get the executable ELF file(clang
2013 Dec 03
2
[LLVMdev] Newbie question: LLVM IR, printf, and varargs
Hi,
I am trying to print two strings using printf. I have tried various
things, but keep getting this error:
llc: printf.ll:4:11: error: '@printf' defined with type 'i32 (i8*,
...)*'
%1 = call i32 @printf(i8* null, i8*, i8* null)
The code is:
declare i32 @printf(i8* nocapture readonly, ...) nounwind
define i32 @main() nounwind {
%1 = call i32
2013 Oct 24
0
[LLVMdev] LLVM use chains
On 23 October 2013 22:41, Vassil Vassilev <vvasilev at cern.ch> wrote:
> Hi,
> I have:
> ...
> @.str1 = private unnamed_addr constant [21 x i8] c"Now f is a
> function\0A\00", align 1
> ; Function Attrs: ssp uwtable
> define i32 @_Z1fv() #2 {
> entry:
> %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([21 x
> i8]* @.str1, i32 0,
2012 Jan 27
2
[LLVMdev] How to get the string value?
Hi, if I have some LLVM code like this:
@.str = private unnamed_addr constant [7 x i8] c"in_arr\00", align 1
@.str1 = private unnamed_addr constant [8 x i8] c"in_arr2\00", align 1
@.str2 = private unnamed_addr constant [8 x i8] c"out_arr\00", align 1
...
...
call void (...)* @_Z16fooz(i8* *getelementptr inbounds ([7 x i8]* @.str,
i64 0, i64 0)*, i32 0, i32 1024)
2011 Sep 09
3
[LLVMdev] runStaticConstructorsDestructors not calling static destructors
Hi there,
I'm having trouble getting ExecutionEngine->runStaticConstructorsDestructors(module, true) to actually trigger static destructors in my code. The static constructors however do get called.
I don't know if this is an LLVM or Clang issue, from looking at the IR (see below) it looks like the destructor is being tied to cxa_atexit, and I wonder if that is not called by
2013 Dec 03
2
[LLVMdev] Newbie question: LLVM IR, printf, and varargs
I just tried adding the cast but it didn't help. I have the feeling that I
am overlooking something very obvious, but I can't seem to figure out what
it is. Thanks for your suggestion, though.
-- Mikael
2013/12/3 Eli Bendersky <eliben at google.com>
>
>
>
> On Tue, Dec 3, 2013 at 2:29 PM, Mikael Lyngvig <mikael at lyngvig.org> wrote:
>
>> Hi,
2013 Dec 03
0
[LLVMdev] Newbie question: LLVM IR, printf, and varargs
On Tue, Dec 3, 2013 at 2:29 PM, Mikael Lyngvig <mikael at lyngvig.org> wrote:
> Hi,
>
> I am trying to print two strings using printf. I have tried various
> things, but keep getting this error:
>
> llc: printf.ll:4:11: error: '@printf' defined with type 'i32 (i8*,
> ...)*'
> %1 = call i32 @printf(i8* null, i8*, i8* null)
>
> The
2011 Sep 09
0
[LLVMdev] runStaticConstructorsDestructors not calling static destructors
On Fri, Sep 9, 2011 at 1:36 PM, Graham Wakefield <wakefield at mat.ucsb.edu> wrote:
> Hi there,
>
> I'm having trouble getting ExecutionEngine->runStaticConstructorsDestructors(module, true) to actually trigger static destructors in my code. The static constructors however do get called.
>
> I don't know if this is an LLVM or Clang issue, from looking at the IR (see
2013 Dec 03
0
[LLVMdev] Newbie question: LLVM IR, printf, and varargs
This code:
declare i32 @printf(i8* nocapture readonly, ...) nounwind
define i32 @bar(i8* %c, i32 %i) #0 {
entry:
%call = tail call i32 (i8*, ...)* @printf(i8* %c, i8* %c)
ret i32 %call
}
Is accepted without complaints by close-to-trunk llc on my Ubuntu machine.
Eli
On Tue, Dec 3, 2013 at 2:58 PM, Mikael Lyngvig <mikael at lyngvig.org> wrote:
> I just tried adding the cast but
2012 Jan 27
0
[LLVMdev] How to get the string value?
Hi Welson Sun,
> Hi, if I have some LLVM code like this:
>
> @.str = private unnamed_addr constant [7 x i8] c"in_arr\00", align 1
> @.str1 = private unnamed_addr constant [8 x i8] c"in_arr2\00", align 1
> @.str2 = private unnamed_addr constant [8 x i8] c"out_arr\00", align 1
> ...
> ...
>
> call void (...)* @_Z16fooz(i8* *getelementptr
2013 Dec 03
2
[LLVMdev] Newbie question: LLVM IR, printf, and varargs
Whoops... Seems I forgot the asterisk (*) after the cast. Or something.
Because I did insert the cast and it didn't work. But NOW it works.
Thank you for spending some time on this - and also for presenting the
solution.
-- Mikael
2013/12/4 Eli Bendersky <eliben at google.com>
> This code:
>
> declare i32 @printf(i8* nocapture readonly, ...) nounwind
>
> define
2012 Jan 27
3
[LLVMdev] How to get the string value?
Thanks Duncan,
Yes, it is a ConstantExpr! Thank you!
Now trying to find a clue in ConstantExpr's functions to get that string :-)
Regards,
Welson
On Thu, Jan 26, 2012 at 9:04 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Welson Sun,
>
> > Hi, if I have some LLVM code like this:
> >
> > @.str = private unnamed_addr constant [7 x i8]
2012 Apr 10
3
[LLVMdev] How to explain this weird phenomenon????????
I did it !!!!
YOU MADE MY DAY !!!!!!!!!!!!!!!
--
祝好!
甄凯
------------------------------------------------------------------------------------------------------
2012-04-10
------------------------------------------------------------------------------------------------------
Name: 甄凯(ZhenKai)
Homepage:http://www.renren.com/262729393
Email: zhenkaixd at 126.com or 846227103 at
2007 Jan 17
1
file.copy
Hi,
Copying a non-existing file with file.copy creates an empty file
> r <- file.copy("non-existing-file", ".")
> r
[1] TRUE
... and returns TRUE!
Now, when used in "vectorized" mode
> r <- file.copy(c("toto1", "toto2"), c("dest1", "dest2"))
[1] FALSE FALSE
file.copy looks much more reasonable,