llvm-project/llvm/lib/CodeGen/SelectionDAG
Hal Finkel 10aac5fd0e [SelectionDAG] Swap commutative binops before constant-based folding
In searching for a fix for the underlying code-quality bug highlighted by
r246937 (that SDAG simplification can lead to us generating an ISD::OR node
with a constant zero LHS), I ran across this:

We generically canonicalize commutative binary-operation nodes in SDAG getNode
so that, if only one operand is a constant, it will be on the RHS.  However, we
were doing this only after a bunch of constant-based simplification checks that
all assume this canonical form (that any constant will be on the RHS). Moving
the operand-swapping canonicalization prior to these checks seems like the
right thing to do (and, as it turns out, causes SDAG to completely fold away the
computation in test/CodeGen/ARM/2012-11-14-subs_carry.ll, just like InstCombine
would do).

llvm-svn: 246938
2015-09-06 05:42:13 +00:00
..
CMakeLists.txt [Statepoints 3/4] Statepoint infrastructure for garbage collection: SelectionDAGBuilder 2014-12-02 18:50:36 +00:00
DAGCombiner.cpp check for fastness before merging in DAGCombiner::MergeConsecutiveStores() 2015-09-03 15:03:19 +00:00
FastISel.cpp FastISel: Avoid adding a successor block twice for degenerate IR. 2015-08-26 20:46:49 +00:00
FunctionLoweringInfo.cpp [EH] Handle non-Function personalities like unknown personalities 2015-08-31 20:02:16 +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 [CodeGen] Support (and default to) expanding READCYCLECOUNTER to 0. 2015-08-28 01:49:59 +00:00
LegalizeFloatTypes.cpp Make TargetLowering::getShiftAmountTy() taking DataLayout as an argument 2015-07-09 02:09:20 +00:00
LegalizeIntegerTypes.cpp [CodeGen] Support (and default to) expanding READCYCLECOUNTER to 0. 2015-08-28 01:49:59 +00:00
LegalizeTypes.cpp Use more foreach loops in SelectionDAG. NFC 2015-07-14 23:43:29 +00:00
LegalizeTypes.h [CodeGen] Support (and default to) expanding READCYCLECOUNTER to 0. 2015-08-28 01:49:59 +00:00
LegalizeTypesGeneric.cpp PseudoSourceValue: Replace global manager with a manager in a machine function. 2015-08-11 23:09:45 +00:00
LegalizeVectorOps.cpp Add new ISD nodes: ISD::FMINNAN and ISD::FMAXNAN 2015-08-11 09:13:05 +00:00
LegalizeVectorTypes.cpp Add new ISD nodes: ISD::FMINNAN and ISD::FMAXNAN 2015-08-11 09:13:05 +00:00
Makefile
ResourcePriorityQueue.cpp Fix some comment typos. 2015-08-08 18:27:36 +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 [SelectionDAG] Swap commutative binops before constant-based folding 2015-09-06 05:42:13 +00:00
SelectionDAGBuilder.cpp [WinEH] Add cleanupendpad instruction 2015-09-03 09:09:43 +00:00
SelectionDAGBuilder.h [WinEH] Add cleanupendpad instruction 2015-09-03 09:09:43 +00:00
SelectionDAGDumper.cpp [WinEH] Add some support for code generating catchpad 2015-08-27 23:27:47 +00:00
SelectionDAGISel.cpp Distribute the weight on the edge from switch to default statement to edges generated in lowering switch. 2015-09-01 01:42:16 +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 PseudoSourceValue: Replace global manager with a manager in a machine function. 2015-08-11 23:09:45 +00:00
StatepointLowering.h [StatepointLowering] Support of the gc.relocates for invoke statepoints. 2015-05-20 11:37:25 +00:00
TargetLowering.cpp Pass function attributes instead of boolean in isIntDivCheap(). 2015-08-25 02:31:21 +00:00
TargetSelectionDAGInfo.cpp Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00