llvm-project/llvm/lib/CodeGen/SelectionDAG
Sanjay Patel 8e5beb6edb Optimize vector fabs of bitcasted constant integer values.
Allow vector fabs operations on bitcasted constant integer values to be optimized
in the same way that we already optimize scalar fabs.

So for code like this:
%bitcast = bitcast i64 18446744069414584320 to <2 x float> ; 0xFFFF_FFFF_0000_0000
%fabs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %bitcast)
%ret = bitcast <2 x float> %fabs to i64

Instead of generating something like this:

movabsq (constant pool loadi of mask for sign bits)
vmovq   (move from integer register to vector/fp register)
vandps  (mask off sign bits)
vmovq   (move vector/fp register back to integer return register)

We should generate:

mov     (put constant value in return register)

I have also removed a redundant clause in the first 'if' statement:
N0.getOperand(0).getValueType().isInteger()

is the same thing as:
IntVT.isInteger()

Testcases for x86 and ARM added to existing files that deal with vector fabs.
One existing testcase for x86 removed because it is no longer ideal.

For more background, please see:
http://reviews.llvm.org/D4770

And:
http://llvm.org/bugs/show_bug.cgi?id=20354

Differential Revision: http://reviews.llvm.org/D4785

llvm-svn: 214892
2014-08-05 17:35:22 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
DAGCombiner.cpp Optimize vector fabs of bitcasted constant integer values. 2014-08-05 17:35:22 +00:00
FastISel.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
FunctionLoweringInfo.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
InstrEmitter.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
InstrEmitter.h Revert "Give internal classes hidden visibility." 2013-09-11 18:05:11 +00:00
LLVMBuild.txt
LegalizeDAG.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
LegalizeFloatTypes.cpp ARM: fix @llvm.convert.from.fp16 on softfloat targets. 2014-07-29 09:56:38 +00:00
LegalizeIntegerTypes.cpp Make sure no loads resulting from load->switch DAGCombine are marked invariant 2014-07-31 21:45:05 +00:00
LegalizeTypes.cpp Make it possible for ints/floats to return different values from getBooleanContents() 2014-07-10 10:18:12 +00:00
LegalizeTypes.h ARM: support legalisation of "fptrunc ... to half" operations. 2014-07-18 13:01:19 +00:00
LegalizeTypesGeneric.cpp AA metadata refactoring (introduce AAMDNodes) 2014-07-24 12:16:19 +00:00
LegalizeVectorOps.cpp Make sure no loads resulting from load->switch DAGCombine are marked invariant 2014-07-31 21:45:05 +00:00
LegalizeVectorTypes.cpp Make sure no loads resulting from load->switch DAGCombine are marked invariant 2014-07-31 21:45:05 +00:00
Makefile
ResourcePriorityQueue.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
SDNodeDbgValue.h This reapplies r207235 with an additional bugfixes caught by the msan 2014-04-25 20:49:25 +00:00
ScheduleDAGFast.cpp [Modules] Remove potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:02:50 +00:00
ScheduleDAGRRList.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
ScheduleDAGSDNodes.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +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 Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
SelectionDAG.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
SelectionDAGBuilder.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
SelectionDAGBuilder.h [stack protector] Fix a potential security bug in stack protector where the 2014-07-25 19:31:34 +00:00
SelectionDAGDumper.cpp Have MachineFunction cache a pointer to the subtarget to make lookups 2014-08-05 02:39:49 +00:00
SelectionDAGISel.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
SelectionDAGPrinter.cpp Revert "Introduce a string_ostream string builder facilty" 2014-06-26 22:52:05 +00:00
TargetLowering.cpp Remove the TargetMachine forwards for TargetSubtargetInfo based 2014-08-04 21:25:23 +00:00
TargetSelectionDAGInfo.cpp Have TargetSelectionDAGInfo take a DataLayout initializer rather than 2014-06-06 19:04:48 +00:00