OSDN Git Service

[X86][InstCombine] Add basic simplification support for BEXTR/BEXTRI intrinsics.
authorCraig Topper <craig.topper@intel.com>
Mon, 31 Jul 2017 18:52:13 +0000 (18:52 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 31 Jul 2017 18:52:13 +0000 (18:52 +0000)
commitdb86040a35c26d29f0f1177fb382ba80133f159f
tree2f1da40e9bee1c96de64725b7dbcd6c5998f87b2
parentc39935fb158d6ae19e24be858940c3c20bcd486e
[X86][InstCombine] Add basic simplification support for BEXTR/BEXTRI intrinsics.

This patch adds simplification support for the BEXTR/BEXTRI intrinsics to match gcc. This only supports cases that fold to 0 or can be fully constant folded. Theoretically we could support converting to AND if the shift part is unused or to only a shift if the mask doesn't modify any bits after an equivalent shl. gcc doesn't do these transformations either.

I put this in InstCombine, but it could be done in InstSimplify. It would be the first target specific intrinsic in InstSimplify.

Differential Revision: https://reviews.llvm.org/D36063

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309603 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/X86/x86-bmi-tbm.ll [new file with mode: 0644]