[llvm] r302991 - [ValueTracking] Remove const_casts on several calls to computeKnownBits and ComputeSignBit. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat May 13 10:22:16 PDT 2017
Author: ctopper
Date: Sat May 13 12:22:16 2017
New Revision: 302991
URL: http://llvm.org/viewvc/llvm-project?rev=302991&view=rev
Log:
[ValueTracking] Remove const_casts on several calls to computeKnownBits and ComputeSignBit. NFC
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
llvm/trunk/lib/Analysis/DemandedBits.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=302991&r1=302990&r2=302991&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Sat May 13 12:22:16 2017
@@ -1284,8 +1284,7 @@ AliasResult BasicAAResult::aliasGEP(cons
const Value *V = DecompGEP1.VarIndices[i].V;
bool SignKnownZero, SignKnownOne;
- ComputeSignBit(const_cast<Value *>(V), SignKnownZero, SignKnownOne, DL,
- 0, &AC, nullptr, DT);
+ ComputeSignBit(V, SignKnownZero, SignKnownOne, DL, 0, &AC, nullptr, DT);
// Zero-extension widens the variable, and so forces the sign
// bit to zero.
Modified: llvm/trunk/lib/Analysis/DemandedBits.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DemandedBits.cpp?rev=302991&r1=302990&r2=302991&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DemandedBits.cpp (original)
+++ llvm/trunk/lib/Analysis/DemandedBits.cpp Sat May 13 12:22:16 2017
@@ -86,13 +86,11 @@ void DemandedBits::determineLiveOperandB
[&](unsigned BitWidth, const Value *V1, const Value *V2) {
const DataLayout &DL = I->getModule()->getDataLayout();
Known = KnownBits(BitWidth);
- computeKnownBits(const_cast<Value *>(V1), Known, DL, 0,
- &AC, UserI, &DT);
+ computeKnownBits(V1, Known, DL, 0, &AC, UserI, &DT);
if (V2) {
Known2 = KnownBits(BitWidth);
- computeKnownBits(const_cast<Value *>(V2), Known2, DL,
- 0, &AC, UserI, &DT);
+ computeKnownBits(V2, Known2, DL, 0, &AC, UserI, &DT);
}
};
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=302991&r1=302990&r2=302991&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Sat May 13 12:22:16 2017
@@ -7513,8 +7513,7 @@ unsigned SelectionDAG::InferPtrAlignment
if (TLI->isGAPlusOffset(Ptr.getNode(), GV, GVOffset)) {
unsigned PtrWidth = getDataLayout().getPointerTypeSizeInBits(GV->getType());
KnownBits Known(PtrWidth);
- llvm::computeKnownBits(const_cast<GlobalValue *>(GV), Known,
- getDataLayout());
+ llvm::computeKnownBits(GV, Known, getDataLayout());
unsigned AlignBits = Known.countMinTrailingZeros();
unsigned Align = AlignBits ? 1 << std::min(31U, AlignBits) : 0;
if (Align)
More information about the llvm-commits
mailing list