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)
commit80a738dc621e59d96ca7ffe11754afde700156f9
tree4dcaeca76882a1e37bd4f18297ce3ba5e1c89e48
parent66c30774700bbfb1ea2bfd546494a90a1894c601
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.

llvm-svn: 209670
llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
llvm/test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep.ll