llvm-6502/lib/Transforms/InstCombine
Bill Wendling 22f3b9faac When the visitSub method was split into visitSub and visitFSub, this xform was
added to the FSub version. However, the original version of this xform guarded
against doing this for floating point (!Op0->getType()->isFPOrFPVector()).

This is causing LLVM to perform incorrect xforms for code like:

void func(double *rhi, double *rlo, double xh, double xl, double yh, double yl){
  double mh, ml;
  double c = 134217729.0;
  double up, u1, u2, vp, v1, v2;
        
  up = xh*c;
  u1 = (xh - up) + up;
  u2 = xh - u1;
        
  vp = yh*c;
  v1 = (yh - vp) + vp;
  v2 = yh - v1;
        
  mh = xh*yh;
  ml = (((u1*v1 - mh) + (u1*v2)) + (u2*v1)) + (u2*v2);
  ml += xh*yl + xl*yh;
        
  *rhi = mh + ml;
  *rlo = (mh - (*rhi)) + ml;
}

The last line was optimized away, but rl is intended to be the difference
between the infinitely precise result of mh + ml and after it has been rounded
to double precision.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 23:23:17 +00:00
..
CMakeLists.txt split and/or/xor out into one overly-large (2000LOC) file. However, I think 2010-01-05 07:50:36 +00:00
InstCombine.h inline and remove the rest of commonIntCastTransforms. 2010-01-10 01:00:46 +00:00
InstCombineAddSub.cpp When the visitSub method was split into visitSub and visitFSub, this xform was 2010-01-13 23:23:17 +00:00
InstCombineAndOrXor.cpp add one more bitfield optimization, allowing clang to generate 2010-01-11 06:55:24 +00:00
InstCombineCalls.cpp Remove unnecessary dyn_cast and add a comment. Part of a WIP. 2010-01-08 21:37:11 +00:00
InstCombineCasts.cpp reenable the piece that turns trunc(zext(x)) -> x even if zext has multiple uses, 2010-01-11 22:49:40 +00:00
InstCombineCompares.cpp tidy up some stuff duncan pointed out. 2010-01-08 17:48:19 +00:00
InstCombineLoadStoreAlloca.cpp split out load/store/alloca. 2010-01-05 05:57:49 +00:00
InstCombineMulDivRem.cpp Convert a ton of simple integer type equality tests to the new predicate. 2010-01-05 20:07:06 +00:00
InstCombinePHI.cpp Add newline at EOF. 2010-01-05 13:32:48 +00:00
InstCombineSelect.cpp Convert a ton of simple integer type equality tests to the new predicate. 2010-01-05 20:07:06 +00:00
InstCombineShifts.cpp change the preferred canonical form for a sign extension to be 2010-01-10 07:08:30 +00:00
InstCombineSimplifyDemanded.cpp move the 'SimplifyDemandedFoo' methods out to their own file, cutting 1K lines out of instcombine.cpp 2010-01-04 07:17:19 +00:00
InstCombineVectorOps.cpp reduce indentation 2010-01-05 05:42:08 +00:00
InstCombineWorklist.h remove a ton of unneeded LLVMContext stuff. 2010-01-04 07:02:48 +00:00
InstructionCombining.cpp teach ComputeNumSignBits to look through PHI nodes. 2010-01-07 23:44:37 +00:00
Makefile