Can a loop be created without a CreatePHI()?

chatgpt tells me, that a loop can be created without using of CreatePHI().

If this is the case, then there is never a need for CreatePHI() as everything can be done via a variable.

So to what does SSA apply?

Does it only apply to already loaded values?

Perhaps you can ask chatGPT what it meant.

If this is the case, then there is never a need for CreatePHI() as everything can be done via a variable

This sentence doesn’t really make sense. It seems there is some general confusion on what SSA is, so I suggest reading some literature/guides explaining it (wikipedia has some general one, but there are likely some easier to read explanations out there).

Firstly, you can always ask Clang:

clang -S -emit-llvm foo.c

while(true) {}

Secondly:
https://llvm.org/docs/LoopTerminology.html

Firstly, you can always ask Clang:

Maybe we need chatClang (clangGPT?)

you forgot to add a fork() into the loop body!

So you’re claiming, that a loop can be created only with a CreatePHI()?

I can make loops just with Function. Why do we need to create BasicBlocks? :sweat_smile:

But just because you can do without something, doesn’t make a thing unnecessary.

unclear.

Clang needs at least a function:

void foo(unsigned *hidden, unsigned tripCount) {
  for(unsigned I = 0; I < tripCount; ++)
  hidden[I] = hidden[I+1];
}