extractConstantWithoutWrapping - use const APInt& returned by SCEVConstant::getAPInt()
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 9 Jul 2020 16:36:26 +0000 (17:36 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 10 Jul 2020 09:24:29 +0000 (10:24 +0100)
Avoids unnecessary APInt copies and silences clang tidy warning.

llvm/lib/Analysis/ScalarEvolution.cpp

index 75926aa..48c686b 100644 (file)
@@ -1353,7 +1353,7 @@ bool ScalarEvolution::proveNoWrapByVaryingStart(const SCEV *Start,
 static APInt extractConstantWithoutWrapping(ScalarEvolution &SE,
                                             const SCEVConstant *ConstantTerm,
                                             const SCEVAddExpr *WholeAddExpr) {
-  const APInt C = ConstantTerm->getAPInt();
+  const APInt &C = ConstantTerm->getAPInt();
   const unsigned BitWidth = C.getBitWidth();
   // Find number of trailing zeros of (x + y + ...) w/o the C first:
   uint32_t TZ = BitWidth;