From 8b1c5e3a26884d8eff1e87d7bf3b5095ff88e356 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 3 Apr 2016 11:33:25 +0000 Subject: [PATCH] llvm_ir_generator: add fast-math flags to fcmp. This is allowed in 3.8. --- artiq/compiler/transforms/llvm_ir_generator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 3bebe513b..816a7d6e8 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -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, - name=insn.name) + 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)