aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-03-07 12:24:55 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-03-07 12:24:55 +0000
commitc9d79e810313a084fe9a699e9242de3a3b0f0444 (patch)
tree1b938709f1e366c11017d10fcfd4c63c6e6c7e6b /llvm/lib/Object/COFFObjectFile.cpp
parent133b6155581809b6fece0175cdb093600528633c (diff)
downloadllvm-c9d79e810313a084fe9a699e9242de3a3b0f0444.zip
llvm-c9d79e810313a084fe9a699e9242de3a3b0f0444.tar.gz
llvm-c9d79e810313a084fe9a699e9242de3a3b0f0444.tar.bz2
[DAGCombiner] Fix wrong folding of AND dag nodes.
This patch fixes the logic in the DAGCombiner that folds an AND node according to rule: (and (X (load V)), C) -> (X (load V)) An AND between a vector load 'X' and a constant build_vector 'C' can be folded into the load itself only if we can prove that the AND operation is redundant. The algorithm implemented by 'visitAND' firstly computes the splat value 'S' from C, and then checks if S has the lower 'B' bits set (where B is the size in bits of the vector element type). The algorithm takes into account also the 'undef' bits in the splat mask. Unfortunately, the algorithm only worked under the assumption that the size of S is a multiple of the vector element type. With this patch, we conservatively avoid folding the AND if the splat bits are not compatible with the vector element type. Added X86 test and-load-fold.ll Differential Revision: http://reviews.llvm.org/D8085 llvm-svn: 231563
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions