summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-01-01 19:21:35 +0000
committerCraig Topper <craig.topper@intel.com>2018-01-01 19:21:35 +0000
commita4f99976750e0aed701a68ffcc5a3b2764082ec9 (patch)
tree2f9cfe8d9debce2ba124daeba492ab7d8a16df92 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent090da2d1ac2e6f7c6e662888bd64f7a75aa96de5 (diff)
downloadbcm5719-llvm-a4f99976750e0aed701a68ffcc5a3b2764082ec9.tar.gz
bcm5719-llvm-a4f99976750e0aed701a68ffcc5a3b2764082ec9.zip
[SelectionDAG][X86][AArch64] Require targets to specify the promotion type when using setOperationAction Promote for INT_TO_FP and FP_TO_INT
Currently the promotion for these ignores the normal getTypeToPromoteTo and instead just tries to double the element width. This is because the default behavior of getTypeToPromote to just adds 1 to the SimpleVT, which has the affect of increasing the element count while keeping the scalar size the same. If multiple steps are required to get to a legal operation type, int_to_fp will be promoted multiple times. And fp_to_int will keep trying wider types in a loop until it finds one that works. getTypeToPromoteTo does have the ability to query a promotion map to get the type and not do the increasing behavior. It seems better to just let the target specify the promotion type in the map explicitly instead of letting the legalizer iterate via widening. FWIW, it's worth I think for any other vector operations that need to be promoted, we have to specify the type explicitly because the default behavior of getTypeToPromote isn't useful for vectors. The other types of promotion already require either the element count is constant or the total vector width is constant, but neither happens by incrementing the SimpleVT enum. Differential Revision: https://reviews.llvm.org/D40664 llvm-svn: 321629
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud