search for: defaultfpmathtag

Displaying 6 results from an estimated 6 matches for "defaultfpmathtag".

2012 Apr 16
3
[LLVMdev] Representing -ffast-math at the IR level
...ator can't change it. Looks a lot safer (mistake-wise) and more convenient. This function won't to remove a previously set tag, which could be used by optimisations or inlining. + Instruction *AddFPMathTag(Instruction *I, MDNode *FPMathTag) const { + if (!FPMathTag) + FPMathTag = DefaultFPMathTag; + if (FPMathTag) + I->setMetadata(LLVMContext::MD_fpmath, FPMathTag); + return I; + } If you want to keep it as only Add, then make FPMathTag = 0 so that you can easily add the default by just calling AddFPMathTag(instr); But I'd add a ClearFPMathTag function for optimisations...
2012 Apr 16
0
[LLVMdev] Representing -ffast-math at the IR level
Here's a revised patch, plus patches showing how fpmath metadata could be turned on in clang and dragonegg (it seemed safest for the moment to condition on -ffast-math rather than on one of the flags implied by -ffast-math). Major changes: - The FPMathOperator class can no longer be used to change math settings, only to read them. Currently it can be queried for accuracy info. I split the
2012 Apr 16
2
[LLVMdev] Representing -ffast-math at the IR level
...accuracy not a positive number!", &I); To be pedantic for a moment, zero is not a positive number. What about asserting these individually to give us more clear asserts if they fire? That also makes the string easier to write: "fpmath accuracy is a negative number!". + /// SetDefaultFPMathTag - Set the floating point math metadata to be used. + void SetDefaultFPMathTag(MDNode *FPMathTag) { DefaultFPMathTag = FPMathTag; } This should be 'setDefault...' much like 'getDefault...' above. + Instruction *AddFPMathTag(Instruction *I, MDNode *FPMathTag) const { Another bad...
2015 Jul 13
2
[LLVMdev] Problem with InsertPointGuard ABI?
...efaultInserter<true> >) $4 = { llvm::IRBuilderBase = { CurDbgLocation = { Loc = { Ref = { MD = 0x0000000000000000 } } } BB = 0x000000010642ecf0 InsertPt = { NodePtr = 0x000000010642ed00 } Context = 0x000000010642d170 DefaultFPMathTag = 0x0000000000000000 FMF = (Flags = 0) } Folder = {} } (lldb) p guard (llvm::IRBuilderBase::InsertPointGuard) $5 = { Builder = 0x00007fff5fbf46d8 Block = { ThePtr = 0x0000000107800398 } Point = { NodePtr = 0x0000000000000000 } DbgLoc = { Loc = { Ref = {...
2012 Apr 16
0
[LLVMdev] Representing -ffast-math at the IR level
...s if they fire? That also makes > the string easier to write: "fpmath accuracy is a negative number!". It will fire on: zero, negative numbers, NaN, +-infinity. Personally I reckon "fpmath accuracy not a positive number!" is reasonable for all of these. > > + /// SetDefaultFPMathTag - Set the floating point math metadata to be used. > + void SetDefaultFPMathTag(MDNode *FPMathTag) { DefaultFPMathTag = FPMathTag; } > > This should be 'setDefault...' much like 'getDefault...' above. The rest of IRBuilder uses a capital S in its setters, so I was just tr...
2012 Apr 14
9
[LLVMdev] Representing -ffast-math at the IR level
The attached patch is a first attempt at representing "-ffast-math" at the IR level, in fact on individual floating point instructions (fadd, fsub etc). It is done using metadata. We already have a "fpmath" metadata type which can be used to signal that reduced precision is OK for a floating point operation, eg %z = fmul float %x, %y, !fpmath !0 ... !0 = metadata