aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2016-10-14 20:41:50 +0000
committerGuozhi Wei <carrot@google.com>2016-10-14 20:41:50 +0000
commit0cd65429befcf5d39ad2e53c0e56252108982916 (patch)
tree9d775dc640d42979d0e722d01a939bcfbb071d6a /llvm/lib/CodeGen/MachineFunction.cpp
parente450e40741cfb19778fdc50c6272f0f0642a65c8 (diff)
downloadllvm-0cd65429befcf5d39ad2e53c0e56252108982916.zip
llvm-0cd65429befcf5d39ad2e53c0e56252108982916.tar.gz
llvm-0cd65429befcf5d39ad2e53c0e56252108982916.tar.bz2
[PPC] Shorter sequence to load 64bit constant with same hi/lo words
This is a patch to implement pr30640. When a 64bit constant has the same hi/lo words, we can use rldimi to copy the low word into high word of the same register. This optimization caused failure of test case bperm.ll because of not optimal heuristic in function SelectAndParts64. It chooses AND or ROTATE to extract bit groups from a register, and OR them together. This optimization lowers the cost of loading 64bit constant mask used in AND method, and causes different code sequence. But actually ROTATE method is better in this test case. The reason is in ROTATE method the final OR operation can be avoided since rldimi can insert the rotated bits into target register directly. So this patch also enhances SelectAndParts64 to prefer ROTATE method when the two methods have same cost and there are multiple bit groups need to be ORed together. Differential Revision: https://reviews.llvm.org/D25521 llvm-svn: 284276
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions