llvm_ir_generator: add fast-math flags to fcmp.

This is allowed in 3.8.
This commit is contained in:
whitequark 2016-04-03 11:33:25 +00:00
parent ad83b092fa
commit 8b1c5e3a26
1 changed files with 4 additions and 2 deletions

View File

@ -980,8 +980,10 @@ class LLVMIRGenerator:
return self.llbuilder.icmp_unsigned(op, lllhs, llrhs,
name=insn.name)
elif isinstance(lllhs.type, ll.DoubleType):
return self.llbuilder.fcmp_ordered(op, lllhs, llrhs,
llresult = self.llbuilder.fcmp_ordered(op, lllhs, llrhs,
name=insn.name)
self.add_fast_math_flags(llresult)
return llresult
elif isinstance(lllhs.type, ll.LiteralStructType):
# Compare aggregates (such as lists or ranges) element-by-element.
llvalue = ll.Constant(lli1, True)