Displaying 20 results from an estimated 200 matches similar to: "writing llvm pass for external library"
2018 Jan 04
0
writing llvm pass to instrument read and write
Hello All,
I am trying to write llvm pass to instrument function in external library. I am using clang to automatically load my pass. I have test.cpp which calls functions in library testlib.so. I have written llvm pass to instrument all reads and writes in test.cpp and call function(recordRW) in testlib.so.
this is how my pass looks like -
for (auto &BB : F) {
for (auto &I : BB)
2008 Dec 17
1
How to iterate dataframe within a hash
Dear all,
I have the following data structure
> print(testlib)
$tags
tag count.raw count.adj err
1 aaaaaaaaaa 94 93 0.5
2 aaaaaaaaac 1 2 0.2
3 aaaaaaaaag 3 2 0.1
4 aaaaaaaaca 1 1 0.003
I want to iterate the data above and print
2007 Aug 30
4
Command line vs config file override for configuration params
Hi all
I''m working on my modular recursive Makefile & svn-backed home for my
Puppet manifests, custom functions, types, etc. So I''m trying to put
together individual modules, test targets and so on.
I have noticed that the $libdir (and probably the other configuration
options too) sources from puppet.conf are not overridden by specifying
--libdir=blah on the commmand line
2007 Feb 02
1
Working demo of search engine using boolean query.
Lately I was reading many articles about using boolean queries for search
engine but I haven't seen any complete working demo. Therefore I put
together very simple working demo of search engine using boolean query. Feel
free to suggest any performance improvement or error while keeping it as
simple as possible for understanding.
Thanks,
-Kevin Duraj
http://myhealthcare.com
2011 Nov 25
0
NUT QA regression testing script (was: Upgraded Buildbot)
Hey Charles and the list,
2011/11/13 Arnaud Quette <aquette.dev at gmail.com>:
>
> 2011/11/12 Charles Lepple <clepple at gmail.com>
>>
>> On Sat, Nov 12, 2011 at 9:41 AM, Arnaud Quette <aquette.dev at gmail.com>
>> wrote:
>> > since I'm working on improving the Ubuntu regression testing suite [1],
>> > which can also serve for
2011 Oct 19
2
[LLVMdev] dyn_cast<BitCastInst> fails?
I am trying to dyn_cast a Value* to a BitCastInst. The dump of what I
want casted is "i8* bitcast (i32 (i32)* @f1 to i8*)", so it is a
BitCastInst. For someone my dyn_cast always fails, does anyone see
why?
arg->dump();
BitCastInst *bitcast = dyn_cast<BitCastInst>(arg);
assert(bitcast != NULL);
Thank you
2011 Oct 12
1
[LLVMdev] getting object from BitCastInst?
My pass is looking at StoreInsts acting on global variable that happen
to be function pointers. From these StoreInsts I would like to get
useful information(the function used if a direct assignment, function
pointer used, etc) from the getValueOperand() method. Looking through
several examples I see that this can return several things like:
GlobalVariable, Function, LoadInst or BitCastInst
2015 Jun 18
3
[LLVMdev] problem with replacing an instruction
I am trying to change this
define void @main(float* noalias %arg0, float* noalias %arg1, float*
noalias %arg2) {
entrypoint:
%0 = bitcast float* %arg1 to <4 x float>*
intothis
define void @main(float* noalias %arg0, float* noalias %arg1, float*
noalias %arg2) {
entrypoint:
%0 = getelementptr float* %arg1, i64 0
%1 = bitcast float* %0 to <4 x float>*
I must be close but
2013 Oct 10
0
[LLVMdev] Illegal BitCast assertion failed
Hi there,
I'm having a bit of a problem while trying to create BitCast instructions.
Well, first, I have some very generic functions written in C, for which I
would like to make calls on another C file I'm playing with using an LLVM
Pass. The simplified signature of two of these functions can be seen below:
void write(void* data, unsigned b); // write b bytes starting, at address
2010 Jun 12
1
[LLVMdev] Memory leak?
Hi folk,
I get the following stack trace and do have any clue how to fix the problem.
0 opt 0x087ecc99
1 opt 0x087ed265
2 0xb7f6a400 __kernel_sigreturn + 0
3 opt 0x086d4198
llvm::LeakDetector::addGarbageObject(llvm::Value const*) + 29
4 opt 0x0872945f llvm::Instruction::Instruction(llvm::Type
const*, unsigned int,
2013 Apr 16
1
[LLVMdev] Instruction does not dominate all uses
Hi,
I am writing an alias profiler using the points-to relation.
For this I'm inserting a function call of external function with the
following type
profile(int,int,int,void*,void*,...)
I'm trying to pass the dereferenced pointer's memory address and the
address of the location who are in alias set of the pointer.
For this i'm using BitCastInst
BitCastInst *init1= new
2010 Sep 30
2
[LLVMdev] strange code behavior when non-prototyped user function are called
I noticed a strange behavior when a non-prototyped user-defined
function is called.
E.g. for the following test.c code segment:
void foo(void);
void bar(void);
void foo(void){
bar();
}
void bar(void){
printf("inside bar()");
}
LLVM-GCC 2.7 -O0 will generate the following code for foo(), which is
all fine.
define void @foo() nounwind {
entry:
* call void @bar() nounwind*
2011 Aug 25
0
[LLVMdev] [RFC] Splitting init.trampoline into init.trampoline and adjust.trampoline
Hi Sanjoy,
> Attached set of patches splits llvm.init.trampoline into an "init"
> phase and an "adjust" phase, as discussed on the "Go on dragonegg"
> thread.
thanks for doing this. The patches look good, though the decomposition into
individual patches is not that great (since things won't always work, in fact
not even compile I think, with not all
2008 Nov 17
1
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
Ah! I get it now. Thanks a lot !
I changed it to BitCastInst(AI,VoidPtrTy,"",j);
And now I am getting the following error :(. I have been stuck with this error before also. I know I am missing out something silly. What is the cause of this error and Please let me know how to fix it.
/home/bhavani/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1130: llvm::SDOperand
2003 Aug 19
1
Problems building dlls for use with winelib
Hi,
I am currently having trouble building the DLLs of an application ported
from Win32 to Winelib - compiling, thanks to some hints from Dimi O.
Paun, now works fine, only(?) the final linking step fails. Since
Winelib-documentation is unfortunately pretty outdated, I tried to
orientate myself on the makefiles of the Winelib dlls in the cvs
/wine/dlls/ directory. I tried the following
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
2008 Nov 17
0
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
ok 1 last question for the day...
I created a function in C.
void writeToFile(char *str)
{
FILE *f;
if((f=fopen("example","a"))==NULL){
printf("could not open file");
}
else{
fprintf(f,str);
fclose(f);}
}
used this to create .bc then using llc -march=cpp I got the cpp code to create this function.
While instrumenting my code, I place call to this function.
2011 Oct 20
0
[LLVMdev] common type at compile time?
On 10/20/11 11:34 AM, ret val wrote:
> I'm a bit confused. For the Type did you mean something like:
> ArrayType *type = ArrayType::get(Type::getInt8PtrTy(M.getContext()), 4);
I assume that creates an ArrayType of 4 elements whose elements are
pointers to 8-bit values. If so, then this is what I meant.
> This does not work, it gives me ""Wrong type in array
2008 Nov 17
1
[LLVMdev] Assertion `InReg && "Value not in map!"' failed
Thanks Nick! ok. I ran through the verifier and this is the issue:
verifying... Instruction does not dominate all uses!
%tmp3 = add i32 %b, %a ; <i32> [#uses=2]
store i32 %tmp3, i32* %0, align 4
Broken module found, compilation aborted!
add is existing instruction in function. store is the instruction I have added to the function. How do I fix this now :(?
Thanks,
Bhavani
--- On Mon,
2017 Aug 10
4
InstCombine GEP
Hi,
I have a doubt with GEP transformation in the instruction-combiner.
Consider below test-case:
struct ABC {
int A;
int B[100];
struct XYZ {
int X;
int Y[100];
} OBJ;
};
void Setup(struct ABC *);
int foo(int offset) {
struct ABC *Ptr = malloc(sizeof(struct ABC));
Setup(Ptr);
return Ptr->OBJ.X + Ptr->OBJ.Y[33];
}
Generated IR for the test-case:
define i32 @foo(i32