mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 04:36:07 +00:00
[InstCombine] Use pointer alignment in SimplifyDemandedBits
For parity with computeKnownBits(). This came up when adding a consistency assertion.
This commit is contained in:
parent
b703bd821d
commit
b8a5a015d1
@ -1022,6 +1022,11 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V, APInt DemandedMask,
|
||||
}
|
||||
}
|
||||
|
||||
if (V->getType()->isPointerTy()) {
|
||||
Align Alignment = V->getPointerAlignment(DL);
|
||||
Known.Zero.setLowBits(Log2(Alignment));
|
||||
}
|
||||
|
||||
// If the client is only demanding bits that we know, return the known
|
||||
// constant. We can't directly simplify pointers as a constant because of
|
||||
// pointer provenance.
|
||||
|
Loading…
x
Reference in New Issue
Block a user