search for: constfold

Displaying 3 results from an estimated 3 matches for "constfold".

Did you mean: confold
2009 Dec 07
2
[LLVMdev] a constant folding case causing different results w/ot optimization
...-1.0f" to 0. As a result, the following routine foo returns 0 with optimization, and returns -1 (0xffffffff) without optimization. unsigned int foo() { float myfloat = -1.0f; unsigned int myint = (unsigned int) myfloat; return myint; } INSTCOMBINE ITERATION #0 on IC: ConstFold to: i32 0 from: %conv = fptoui float -1.000000e+000 to i32 ; <i32> [#uses=1] While the result of "(unsigned int) -1.0f" is probably implementation defined, both gcc and Microsoft cl produce -1. Will you consider this an optimizer bug and fix it? Thanks, bix...
2014 Sep 19
2
[LLVMdev] More careful treatment of floating point exceptions
Hi Sanjay, Thanks, I saw this flag and it's definitely should be considered, but it appeared to me to be static characteristic of target platform. I'm not sure how appropriate it would be to change its value from a front-end. It says "Has", while optional flag would rather say "Uses" meaning that implementation cares about floating point exceptions. Regards, Sergey
2014 Sep 25
2
[LLVMdev] More careful treatment of floating point exceptions
...mp; isa<Constant>(Inst->getOperand(0))) - if (Constant *C = ConstantFoldInstruction(Inst, DL, TLI)) { + if (Constant *C = ConstantFoldInstruction(Inst, DL, TLI, + HonorFPExceptions)) { DEBUG(dbgs() << "IC: ConstFold to: " << *C << " from: " << *Inst << '\n'); Inst->replaceAllUsesWith(C); @@ -2679,10 +2681,13 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB, if (CE == nullptr) continue; Constant*...