llvm-6502/lib/CodeGen/SelectionDAG
Juergen Ributzka d10a9fb25a [DAG] During DAG legalization keep opaque constants even after expanding.
The included test case would return the incorrect results, because the expansion
of an shift with a constant shift amount of 0 would generate undefined behavior.

This is because ExpandShiftByConstant assumes that all shifts by constants with
a value of 0 have already been optimized away. This doesn't happen for opaque
constants and usually this isn't a problem, because opaque constants won't take
this code path - they are not supposed to. In the case that the opaque constant
has to be expanded by the legalizer, the legalizer would drop the opaque flag.
In this case we hit the limitations of ExpandShiftByConstant and create incorrect
code.

This commit fixes the legalizer by not dropping the opaque flag when expanding
opaque constants and adding an assertion to ExpandShiftByConstant to catch this
not supported case in the future.

This fixes <rdar://problem/16718472>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207304 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 02:58:04 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
DAGCombiner.cpp Fix an infinite loop bug in DAG Combine about keeping transfering between ANY_EXTEND and SIGN_EXTEND. 2014-04-22 09:57:06 +00:00
FastISel.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
FunctionLoweringInfo.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
InstrEmitter.cpp This reapplies r207235 with an additional bugfixes caught by the msan 2014-04-25 20:49:25 +00:00
InstrEmitter.h Revert "Give internal classes hidden visibility." 2013-09-11 18:05:11 +00:00
LegalizeDAG.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-14 00:51:57 +00:00
LegalizeFloatTypes.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
LegalizeIntegerTypes.cpp [DAG] During DAG legalization keep opaque constants even after expanding. 2014-04-26 02:58:04 +00:00
LegalizeTypes.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
LegalizeTypes.h [Modules] Sink the DEBUG_TYPE macro out of LegalizeTypes.h and into the 2014-04-21 19:43:07 +00:00
LegalizeTypesGeneric.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
LegalizeVectorOps.cpp [VectorLegalizer/X86] Don't unvectorize fp_to_uint for v8f32->v8i16 2014-03-17 17:06:14 +00:00
LegalizeVectorTypes.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
LLVMBuild.txt
Makefile
ResourcePriorityQueue.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
ScheduleDAGFast.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
ScheduleDAGRRList.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
ScheduleDAGSDNodes.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
ScheduleDAGSDNodes.h [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-16 04:21:27 +00:00
ScheduleDAGVLIW.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
SDNodeDbgValue.h This reapplies r207235 with an additional bugfixes caught by the msan 2014-04-25 20:49:25 +00:00
SelectionDAG.cpp This reapplies r207235 with an additional bugfixes caught by the msan 2014-04-25 20:49:25 +00:00
SelectionDAGBuilder.cpp This reapplies r207235 with an additional bugfixes caught by the msan 2014-04-25 20:49:25 +00:00
SelectionDAGBuilder.h This reapplies r207235 with an additional bugfixes caught by the msan 2014-04-25 20:49:25 +00:00
SelectionDAGDumper.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-14 00:51:57 +00:00
SelectionDAGISel.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
SelectionDAGPrinter.cpp [Modules] Make Support/Debug.h modular. This requires it to not change 2014-04-21 22:55:11 +00:00
TargetLowering.cpp [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. 2014-04-14 00:51:57 +00:00
TargetSelectionDAGInfo.cpp Rename some member variables from TD to DL. 2014-02-18 15:33:12 +00:00