[llvm-dev] getUserCost(): "Ext of i/fcmp results are mostly optimized away in codegen"

Jonas Paulsson via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 26 06:20:27 PDT 2018


Hi,

I wonder why the extension of i1 is per default considered free in 
getUserCost(). The comment says that these are "mostly optimized away in 
codegen", but I wonder how that can be: If the i1 is extended then a 
register must be loaded with either a 0 or (-)1 after the comparison, or?

I have made some test functions that seem to result in compare + 
conditional move on SystemZ (or a setcc on Intel). See 
https://reviews.llvm.org/D53373. On both of these targets this is 
clearly not free.

Are those simple tests I made special in any way so that they might call 
for some general rule in the generic implementation?

Any example of when this extension is actually free?

/Jonas




More information about the llvm-dev mailing list