Distribute sext/zext to the operands of and/or/xor
authorJingyue Wu <jingyue@google.com>
Tue, 27 May 2014 18:00:00 +0000 (18:00 +0000)
committerJingyue Wu <jingyue@google.com>
Tue, 27 May 2014 18:00:00 +0000 (18:00 +0000)
commit585644611e1f696bbd8f95a5eb75fc808b1cfdb6
tree8f675bc4b768929156537cf62dc53763cc011e94
parent991c9c1c8919c77342c61c6b8263cbd30501809d
Distribute sext/zext to the operands of and/or/xor

This is an enhancement to SeparateConstOffsetFromGEP. With this patch, we can
extract a constant offset from "s/zext and/or/xor A, B".

Added a new test @ext_or to verify this enhancement.

Refactoring the code, I also extracted some common logic to function
Distributable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209670 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll