217 questions
2
votes
0
answers
47
views
Profile-Guided-Optimizations by GCC - Profile File Analysis
I am working with Profile-Guided Optimizations (PGO) with GCC, using -fprofile-generate to collect execution data and -fprofile-use to optimize your executable based on the collected profile (.gcda ...
0
votes
0
answers
2k
views
'pip install vllm' fails
when install vllm in windows, i got an error msg.
cuda11.7, torch2.0.1+cu117.
i suspect it is due to version compatibility and downgraded cuda from 12.2 to 11.7. but still not working.
File "C:\...
0
votes
1
answer
491
views
Replacing RHS of an instruction with an instruction in LLVM
Here is the problem,
Lets say suppose, I have the following instruction
%add = add nsw i32 %argc, 50
I would like at first, create a Binary instruction something like below
%T1 = add nsw i32 %argc, ...
1
vote
1
answer
188
views
How to change the operand type in the instruction from 32bit to 64bit in LLVM?
I am a newbie to LLVM. And I am trying to change the type of the loop variable (PHINode).
For example, I have an IR as follows:
for.cond1.preheader: ; preds = %entry, %for....
0
votes
1
answer
320
views
not able to generate controll flow graphs for big programs using LLVM clang
I want to create a software-generated control flow diagram for this code using LLVM CFG https://github.com/inmcm/Simon_Speck_Ciphers/blob/master/C/speck.c
But when I followed the instructions given on ...
0
votes
0
answers
59
views
If I am building an OS, does it make sense for me to use my host OS's gcc compiler?
I am following the tutorial at https://littleosbook.github.io/ and wanted to understand whether or not what I have currently working is conceptually correct. In terms of where I am at, I am using ...
0
votes
0
answers
483
views
How can we get the program counter address using LLVM compiler?
I am trying to write an LLVM pass which would pass the program counter as an argument. However, I am not sure as to which command or how exactly one can get the program counter address using the llvm ...
1
vote
0
answers
1k
views
Expected relocatable expression
I'm trying to compile a sample from Multiboot 2 specification on MacOS using LLVM but I failed at the start. I want to create an object file from boot.S with included multiboot2.h so I call gcc -m32 ...
0
votes
1
answer
890
views
Clang error: Cannot compile builtin function
I'm compiling a code which has GCC library extra separately added. While compiling it with clang error
cannot compile
is showing
I've tried added flags. -std=89gnu does not work with a clang. After ...
2
votes
1
answer
324
views
issues with Visual Studio Code (mac) and langage C
I need to learn to code in C for my studies, so i use Visual studio code for this.
I had to code in Pascal before, that's why I already have xcode, install fpc.
Recently, i wanted to do some cleaning ...
3
votes
1
answer
3k
views
llvm - get users of an instruction
I am trying to get the users of alloca instruction (to basically get the users of a variable). I am using the following code to do so:
virtual bool runOnModule(Module &M)
{
for(Module::...
3
votes
1
answer
2k
views
llvm - fastest way of checking if function A is calling function B
I need to check if function A in my file is calling function B. My current approach is to go through all the instructions in function A and see if any of the call/invoke instructions are calling B. ...
0
votes
1
answer
1k
views
Printing integer in x86 assembly
I am trying to print an integer in 32 bit x86 assembly on macOS High Sierra using this code:
.cstring
STR_D:
.asciz "%d"
.globl _main
_main:
movl $53110, %edi #moves constant int into ...
2
votes
1
answer
326
views
llvm - write a pass that checks if a function is present in a file
What I'm trying to achieve here is simple. I need my pass to go through the functions in a file (and hence, FunctionPass) and check if one of them is the one I'm looking for. I want to achieve this in ...
11
votes
1
answer
7k
views
LLVM IR : C++ API : Typecast from i1 to i32 and i32 to i1
I am writing a compiler for a self-made language which can handle only int values i.e. i32. Conditions and expressions are similar to C language. Thus, I am considering conditional statements as ...
1
vote
2
answers
160
views
How to tell the GCC compiler that code should be generated serial, i.e., without jumps
How to tell the GCC compiler that code should be generated serial, i.e., without jumps.
I'm working on a project that embeds inline assembly into a C source code (or LLVM IR).
My implementation ...
1
vote
1
answer
1k
views
Create functions in llvm pass with arguments and return type of type uint32_t and long double
Is there any way to create a function with return type and arguments as uint32_t and long double?
For example, we can create argument of type int as follows:
std::vector<Type*>FuncTy_args;
...
0
votes
0
answers
127
views
execute linux commands in llvm pass
Is there any way to execute linux commands in llvm pass and parse the objdump in it.
For example in python we can do as follows:
os.system('gcc example.c -o example')
os.system('objdump -o example &...
2
votes
1
answer
2k
views
Get the arguments of a function in bitcasts in calls, llvm
I am pretty new with llvm and having trouble digging deep into the following IR line:
%call2 = call float bitcast (float (float, i32*)* @function to float (float, i32 addrspace(1)*)*)(float %11, i32 ...
2
votes
0
answers
839
views
fatal error: 'bits/c++config.h' file not found
I am getting the following error when I compile STABILIZER:
fatal error: 'bits/c++config.h' file not found.
I am using ubuntu14.04,gcc-4.6.
1
vote
0
answers
373
views
convert formal argument to local variable in LLVM
I am doing a project on LLVM.
I'm trying to make a pass:
For a function,
if the arguments(parameters) are constants,
it will make a new function that the constants are
converted to a local variable,...
0
votes
1
answer
2k
views
LLVM undefined reference to llvm::createDemoteRegisterToMemoryPass
I'm working on OLLVM (https://github.com/obfuscator-llvm/obfuscator), which is an obfuscation project based LLVM. I'm getting the error message above when trying to use reg2mem pass in my own pass. ...
3
votes
1
answer
1k
views
Why retain count is diffrent in debug mode and in running mode?
I know that how ARC and MRC works. but I am confuse while testing the below code. I don't know why this happen. Why the retain count is different in debug mode and in running mode for the same ...
1
vote
1
answer
230
views
Issue with LLVM FunctionPass iterator?
I have a very basic pass that need to print how many BasicBlocks are there in a Function.
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/Support/...
1
vote
0
answers
311
views
‘gcroot’ attribute directive ignored
I get this warning when compiling:
main.c:20:12: warning: ‘gcroot’ attribute directive ignored [-Wattributes]
struct C __attribute__((gcroot)) *garbage = new_C(0);
Is this attribute no longer ...