llvm-project/llvm/lib/CodeGen/SelectionDAG
Sanjay Patel b6a79f9916 revert r243687: enable fast-math-flag propagation to DAG nodes
We can't propagate FMF partially without breaking DAG-level CSE. We either need to
relax CSE to account for mismatched FMF as a temporary work-around or fully propagate
FMF throughout the DAG.

Surprisingly, there are no existing regression tests for this, but here's an example:

  define float @fmf(float %a, float %b) {
    %mul1 = fmul fast float %a, %b
    %nega = fsub fast float 0.0, %a
    %mul2 = fmul fast float %nega, %b
    %abx2 = fsub fast float %mul1, %mul2
    ret float %abx2
  }


$ llc -o - badflags.ll -march=x86-64 -mattr=fma -enable-unsafe-fp-math -enable-fmf-dag=0
...
    vmulss    %xmm1, %xmm0, %xmm0
    vaddss    %xmm0, %xmm0, %xmm0
    retq

$ llc -o - badflags.ll -march=x86-64 -mattr=fma -enable-unsafe-fp-math -enable-fmf-dag=1
...
    vmulss    %xmm1, %xmm0, %xmm2
    vfmadd213ss    %xmm2, %xmm1, %xmm0  <--- failed to recognize that (a * b) was already calculated
    retq

llvm-svn: 244053
2015-08-05 15:12:03 +00:00
..
CMakeLists.txt [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
DAGCombiner.cpp wrap OptSize and MinSize attributes for easier and consistent access (NFCI) 2015-08-04 15:49:57 +00:00
FastISel.cpp Make getByValTypeAlignment() taking DataLayout as an argument 2015-07-09 02:09:28 +00:00
FunctionLoweringInfo.cpp Redirect DataLayout from TargetMachine to Module in ComputeValueVTs() 2015-07-09 01:57:34 +00:00
InstrEmitter.cpp Redirect DataLayout from TargetMachine to Module in SelectionDAG 2015-07-07 19:07:19 +00:00
InstrEmitter.h [SDAG] Give InstrEmitter hidden visibility 2015-07-01 14:55:10 +00:00
LLVMBuild.txt
LegalizeDAG.cpp [SDAG] Fix a result chain in ExpandUnalignedLoad 2015-08-04 06:29:12 +00:00
LegalizeFloatTypes.cpp Make TargetLowering::getShiftAmountTy() taking DataLayout as an argument 2015-07-09 02:09:20 +00:00
LegalizeIntegerTypes.cpp [Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation 2015-07-16 15:22:46 +00:00
LegalizeTypes.cpp Use more foreach loops in SelectionDAG. NFC 2015-07-14 23:43:29 +00:00
LegalizeTypes.h [CodeGen] Fix FCOPYSIGN legalization to account for mismatched types. 2015-08-04 00:32:55 +00:00
LegalizeTypesGeneric.cpp Make TargetLowering::getPointerTy() taking DataLayout as an argument 2015-07-09 02:09:04 +00:00
LegalizeVectorOps.cpp [Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation 2015-07-16 15:22:46 +00:00
LegalizeVectorTypes.cpp [CodeGen] Fix FCOPYSIGN legalization to account for mismatched types. 2015-08-04 00:32:55 +00:00
Makefile
ResourcePriorityQueue.cpp unique_ptrify ResourcePriorityQueue::ResourceModel 2015-03-03 20:49:08 +00:00
SDNodeDbgValue.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ScheduleDAGFast.cpp Add allnodes() iterator range to SelectionDAG. NFC. 2015-07-14 22:10:54 +00:00
ScheduleDAGRRList.cpp Convert a bunch of loops to foreach. NFC. 2015-06-26 19:18:49 +00:00
ScheduleDAGSDNodes.cpp Add allnodes() iterator range to SelectionDAG. NFC. 2015-07-14 22:10:54 +00:00
ScheduleDAGSDNodes.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
ScheduleDAGVLIW.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
SelectionDAG.cpp wrap OptSize and MinSize attributes for easier and consistent access (NFCI) 2015-08-04 15:49:57 +00:00
SelectionDAGBuilder.cpp revert r243687: enable fast-math-flag propagation to DAG nodes 2015-08-05 15:12:03 +00:00
SelectionDAGBuilder.h New EH representation for MSVC compatibility 2015-07-31 17:58:14 +00:00
SelectionDAGDumper.cpp Fix __builtin_setjmp in combination with sjlj exception handling. 2015-07-16 22:34:16 +00:00
SelectionDAGISel.cpp Move the Target way of overriding DAG Scheduler to a target hook 2015-07-28 06:18:04 +00:00
SelectionDAGPrinter.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
StatepointLowering.cpp [Statepoints] Let patchable statepoints have a symbolic call target. 2015-07-28 23:50:30 +00:00
StatepointLowering.h [StatepointLowering] Support of the gc.relocates for invoke statepoints. 2015-05-20 11:37:25 +00:00
TargetLowering.cpp Implement target independent TLS compatible with glibc's emutls.c. 2015-07-28 16:24:05 +00:00
TargetSelectionDAGInfo.cpp Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00