Hi, I'm wondering why lib/AsmParser/LLParser handles fast-math flags in the following IR: ... %val = fmul nnan double 1.0, 1.0 ... but doesn't allow any flags if "fmul" is inside "phi": ... %val = phi double [ fmul (double 1.0, double 1.0), %cond.true ], [ fmul (double 1.0, double 1.0), %cond.false ] ... LLParser::ParseValID(...) could call EatFastMathFlagsIfPresent() to handle fast-math flags, but it doesn't. Is this intended or a bug? Regards, Sergey
Doesn't look like a bug, more like a limitation of constant expressions as llvm::BinaryConstantExpr doesn't have FastMastFlags. -- Sergey On Thu, Nov 27, 2014 at 03:39:20PM +0200, Sergey Dmitrouk wrote:> Hi, > > I'm wondering why lib/AsmParser/LLParser handles fast-math flags in the > following IR: > > ... > %val = fmul nnan double 1.0, 1.0 > ... > > but doesn't allow any flags if "fmul" is inside "phi": > > ... > %val = phi double [ fmul (double 1.0, double 1.0), %cond.true ], > [ fmul (double 1.0, double 1.0), %cond.false ] > ... > > LLParser::ParseValID(...) could call EatFastMathFlagsIfPresent() to > handle fast-math flags, but it doesn't. Is this intended or a bug? > > Regards, > Sergey
Out of curiosity, how would you envision fast-math flags interacting with constant expressions? Off the top of my head, I can’t think of any flags that would be relevant if the expression can just be constant-folded away at full precision anyways.> On Nov 28, 2014, at 4:56 AM, Sergey Dmitrouk <sdmitrouk at accesssoftek.com> wrote: > > Doesn't look like a bug, more like a limitation of constant expressions > as llvm::BinaryConstantExpr doesn't have FastMastFlags. > > -- > Sergey > > On Thu, Nov 27, 2014 at 03:39:20PM +0200, Sergey Dmitrouk wrote: >> Hi, >> >> I'm wondering why lib/AsmParser/LLParser handles fast-math flags in the >> following IR: >> >> ... >> %val = fmul nnan double 1.0, 1.0 >> ... >> >> but doesn't allow any flags if "fmul" is inside "phi": >> >> ... >> %val = phi double [ fmul (double 1.0, double 1.0), %cond.true ], >> [ fmul (double 1.0, double 1.0), %cond.false ] >> ... >> >> LLParser::ParseValID(...) could call EatFastMathFlagsIfPresent() to >> handle fast-math flags, but it doesn't. Is this intended or a bug? >> >> Regards, >> Sergey > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reasonably Related Threads
- [LLVMdev] Fast-math flags in constant expressions
- [LLVMdev] "Duplicate option categories" assertion triggered loading an LLVM-project
- [LLVMdev] Pseudo load and store instructions for AArch64
- [LLVMdev] More careful treatment of floating point exceptions
- [LLVMdev] More careful treatment of floating point exceptions