[LLVMdev] input and output values from a loop (original) (raw)
Imran Ashraf iimran.aashraf at yahoo.com
Thu Jul 2 09:40:23 PDT 2015
- Previous message: [LLVMdev] llc argument -filter-view-dags does not take name with dot
- Next message: [LLVMdev] input and output values from a loop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi there,
I want to get input and output values from a loop. For this I am doing something like this:
DominatorTree &DT = getAnalysis().getDomTree(); CodeExtractor Extractor(DT, *L); Extractor.findInputsOutputs(inputs, outputs);
When I print the input and output values for the following test code:
void aFunc(void) { int sum=0; puts("aFunc()"); for (int i = 0; i < 10; i++) { int fact=i*2; sum=sum+i+fact; } printf("%d",sum); }
I get the following:
Inputs type i32* name i type i32* name fact type i32* name sum
Outputs
However, I was expecting the output to be:
Inputs type i32* name sum
Outputs type i32* name sum
To my understanding, i and fact are declared inside the loop, hence they are neither input nor output. Secondly, sum is being used outside the loop, hence should appear in outputs.
Is this the right way of doing it or am i doing some thing wrong?
Complete working code can be found at: https://github.com/imranashraf/llvm-pass-exercise1
Thanks in advance for help. Kind regards,
- Previous message: [LLVMdev] llc argument -filter-view-dags does not take name with dot
- Next message: [LLVMdev] input and output values from a loop
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]