Hi, I want to control the program to keep the basic block 32 bytes aligned.
So, I use “-align-all-blocks=5” option
clang -o simple simple.c -mllvm -align-all-blocks=5
I checked the assembly code generated in the middle and found that a small portion of the code was not aligned.
So, I want to do it myself. Specifically, the following requirements should be met:
The program is aligned at the assembly layer in basic blocks of 32 bytes；
All control flow transfer instructions must be the end of a block.
For some reason, some instructions cannot be the beginning of a block, so I have to insert some nops.
What should I do in the LLVM IR level in order for the program to meet the above requirements in the assembly level?
Can you give me some advice on this?
Please help me!