forked from M-Labs/artiq
1
0
Fork 0

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 committed by Sebastien Bourdeauducq
parent d4f1614a23
commit c6f946a816
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, return self.llbuilder.icmp_unsigned(op, lllhs, llrhs,
name=insn.name) name=insn.name)
elif isinstance(lllhs.type, ll.DoubleType): 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) name=insn.name)
self.add_fast_math_flags(llresult)
return llresult
elif isinstance(lllhs.type, ll.LiteralStructType): elif isinstance(lllhs.type, ll.LiteralStructType):
# Compare aggregates (such as lists or ranges) element-by-element. # Compare aggregates (such as lists or ranges) element-by-element.
llvalue = ll.Constant(lli1, True) llvalue = ll.Constant(lli1, True)