diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-04-21 19:16:52 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-04-21 19:16:52 +0000 |
| commit | 0f001a470175b1f06dba8be4b1c077326953922d (patch) | |
| tree | 690cb82b65c0a09a93adb655b1431333f163af45 /llvm/lib/Transforms | |
| parent | ab6b47d2e75c8d3cb178d4ce60f7d416cff301cc (diff) | |
| download | bcm5719-llvm-0f001a470175b1f06dba8be4b1c077326953922d.tar.gz bcm5719-llvm-0f001a470175b1f06dba8be4b1c077326953922d.zip | |
[InstCombine] use isSubsetOf() for efficiency
C | ~D == -1
~(C | ~D) == 0
~C & D == 0
D & ~C == 0
D.isSubsetOf(C)
llvm-svn: 301021
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index d7e709c9cca..10faf478676 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -282,7 +282,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, // combining, SCEV, and codegen. const APInt *C; if (match(I->getOperand(1), m_APInt(C)) && !C->isAllOnesValue()) { - if ((*C | ~DemandedMask).isAllOnesValue()) { + if (DemandedMask.isSubsetOf(*C)) { // Force bits to 1 to create a 'not' op. I->setOperand(1, ConstantInt::getAllOnesValue(VTy)); return I; |

