You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I've been trying to conditionally specialize a global integer variable but was getting an assertion error Assertion failed: (ConstType->isIntegerTy() || (ConstType->isPointerTy() && !assumeInt)) && "Instructions with an integer assumption must be integer typed" every time LLPE tries to specialize the program. Note that I have tried conditionally specializing an integer argument to a function as well which results in the same assertion failure. I am wondering if I'm using LLPE correctly?
Below is the C code that is being specialized, where global_int is the global variable that serves as the condition:
#include "string.h"
#include "stdio.h"
int global_int = 3;
int exponent (int e) { // assume e >= 1
int result = 1;
for (int i = 0; i < e; i++) {
result *= global_int;
}
return result;
}
int main(int argc, char** argv) {
int ret = 0;
for (int i = 0; i < 10; i++) {
ret += exponent(5);
}
printf("%i\n", ret);
return ret;
}
Here are the commands that I am running in terminal to conditionally specialize the program:
Hi there, I've been trying to conditionally specialize a global integer variable but was getting an assertion error
Assertion failed: (ConstType->isIntegerTy() || (ConstType->isPointerTy() && !assumeInt)) && "Instructions with an integer assumption must be integer typed"
every time LLPE tries to specialize the program. Note that I have tried conditionally specializing an integer argument to a function as well which results in the same assertion failure. I am wondering if I'm using LLPE correctly?Below is the C code that is being specialized, where
global_int
is the global variable that serves as the condition:Here are the commands that I am running in terminal to conditionally specialize the program:
And below is the resulting output:
Thank you for your time and greatly appreciate any help here!
The text was updated successfully, but these errors were encountered: