Temporary register subscript

Hi Folks,

I noticed that recently in the online code gen demo that generating the unique temporaries have been modified.

I don’t believe i changed any options. (C++, demangle names, no optimization)


if(x >= y){

Previously Compiles to:

%0 = load i32* %x, align 4

%1 = load i32* %y, align 4
%2 = icmp sge i32 %0, %1
br i1 %2, label %bb, label %bb1

; true goes here

Currently Compiles to:

%tmp = load i32* %x                             
%tmp1 = load i32* %y                           
%cmp = icmp sge i32 %tmp, %tmp1                 
br i1 %cmp, label %if.then, label %if.end

; true goes here

If this is the case then is there a mailing list or Status update page that reflects this behavior? 

My question may seem trivial however, im still in llvm exploration mode :slight_smile:

Im working on a compiler that generates LLVM IR and for the moment i dont use the code gen API. I rely on the Assembly manual and demo for reference (Although at some point i will need to use the API in order to take full advantage).


Yes, we recently replaced the compiler on the demo page. Both syntax
forms have the same meaning; changing the name of anything that is not
a global does not affect code generation. Giving the values names
tends to be a bit more convenient for compiler developers to read.
Most values are named in builds with asserts enabled, but are not
named in builds without assertions for performance reasons. I guess
the build the demo page is using is a build with assertions enabled at
the moment.


Hi Eli,

Ok, I understand the SSA meaning is intact regardless of the representation.
Thanks for the interesting clarification on the demo behavior regarding asserts!