summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/ASTMatchFinder.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-01-16 14:55:26 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-01-16 14:55:26 +0000
commitae47bc6ab9f636a1abed6310a18f8dba6c2151da (patch)
tree1287a7558e3a912579e9cbf9443ae8d7f075806e /clang/lib/ASTMatchers/ASTMatchFinder.cpp
parent05f69299325a15a3cb9ba3a1bad0d636ec258769 (diff)
downloadbcm5719-llvm-ae47bc6ab9f636a1abed6310a18f8dba6c2151da.tar.gz
bcm5719-llvm-ae47bc6ab9f636a1abed6310a18f8dba6c2151da.zip
[X86][DAG] Disable target specific combine on INSERTPS dag nodes at -O0.
This patch disables target specific combine on X86ISD::INSERTPS dag nodes if optlevel is CodeGenOpt::None. The backend currently implements a target specific combine rule that converts a vector load used by an INSERTPS dag node into a scalar load plus a scalar_to_vector. This allows ISel to select a single INSERTPSrm instead of two instructions (i.e. a vector load plus INSERTPSrr). However, the existing target combine rule on INSERTPS nodes only works under the assumption that ISel will always be able to match an INSERTPSrm. This is not true in general at -O0, since the backend only allows folding a load into the memory operand of an instruction if the optimization level is not CodeGenOpt::None. In the example below: // __m128 test(__m128 a, __m128 *b) { __m128 c = _mm_insert_ps(a, *b, 1 << 6); return c; } // Before this patch, at -O0, the backend would have canonicalized the load to 'b' into a scalar load plus scalar_to_vector. Later on, ISel would have selected an INSERTPSrr leaving the insertps mask in an inconsistent state: movss 4(%rdi), %xmm1 insertps $64, %xmm1, %xmm0 # xmm0 = xmm1[1],xmm0[1,2,3]. With this patch, the backend avoids folding the vector load into the operand of the INSERTPS. The new codegen at -O0 is: movaps (%rdi), %xmm1 insertps $64, %xmm1, %xmm0 # %xmm1[1],xmm0[1,2,3]. llvm-svn: 226277
Diffstat (limited to 'clang/lib/ASTMatchers/ASTMatchFinder.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud