[llvm-commits] [llvm-gcc] SETCC Removal Patch (Please Commit)

Reid Spencer rspencer at reidspencer.com
Sat Dec 30 08:18:53 PST 2006


Rafael,

Nothing was attached to your message.

Reid.

On Sat, 2006-12-30 at 11:38 -0200, Rafael EspĂ­ndola wrote:
> I don't have a normative document at hand, but I believe that in C !=
> should return true if one of the operands is unordered. Currently,
> llvm-gcc produces a "fcmp one".
> 
> I have patched llvm-conver.cpp:TreeToLLVM::Emit to emit a "fcmp une"
> in the NE_EXPR case. The  generated code now is:
> 
> %tmp = fcmp une float %a, %b
> %tmp2 = tail call bool %llvm.isunordered.f32( float %a, float %b )
> %tmp3 = or bool %tmp2, %tmp
> 
> Correct, but redundant. The call to llvm.isunordered is added by
> TreeToLLVM::EmitCompare. Simply removing the "if" produces the correct
> code. It looks like the call to isunordered is a leftover of the old
> compare instruction.
> 
> An updated patch is attached.
> 
> Comments?
> 
> Best Regards,
> Rafael




More information about the llvm-commits mailing list