Update prebuilt Clang to match Android kernel.
Bug: 132428451
Change-Id: I8f6e2cb23f381fc0c02ddea99b867e58e925e5be
diff --git a/linux-x64/clang/include/llvm/Analysis/DemandedBits.h b/linux-x64/clang/include/llvm/Analysis/DemandedBits.h
index d438460..04db3eb 100644
--- a/linux-x64/clang/include/llvm/Analysis/DemandedBits.h
+++ b/linux-x64/clang/include/llvm/Analysis/DemandedBits.h
@@ -1,9 +1,8 @@
//===- llvm/Analysis/DemandedBits.h - Determine demanded bits ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -44,19 +43,30 @@
F(F), AC(AC), DT(DT) {}
/// Return the bits demanded from instruction I.
+ ///
+ /// For vector instructions individual vector elements are not distinguished:
+ /// A bit is demanded if it is demanded for any of the vector elements. The
+ /// size of the return value corresponds to the type size in bits of the
+ /// scalar type.
+ ///
+ /// Instructions that do not have integer or vector of integer type are
+ /// accepted, but will always produce a mask with all bits set.
APInt getDemandedBits(Instruction *I);
/// Return true if, during analysis, I could not be reached.
bool isInstructionDead(Instruction *I);
+ /// Return whether this use is dead by means of not having any demanded bits.
+ bool isUseDead(Use *U);
+
void print(raw_ostream &OS);
private:
void performAnalysis();
void determineLiveOperandBits(const Instruction *UserI,
- const Instruction *I, unsigned OperandNo,
+ const Value *Val, unsigned OperandNo,
const APInt &AOut, APInt &AB,
- KnownBits &Known, KnownBits &Known2);
+ KnownBits &Known, KnownBits &Known2, bool &KnownBitsComputed);
Function &F;
AssumptionCache ∾
@@ -67,6 +77,9 @@
// The set of visited instructions (non-integer-typed only).
SmallPtrSet<Instruction*, 32> Visited;
DenseMap<Instruction *, APInt> AliveBits;
+ // Uses with no demanded bits. If the user also has no demanded bits, the use
+ // might not be stored explicitly in this map, to save memory during analysis.
+ SmallPtrSet<Use *, 16> DeadUses;
};
class DemandedBitsWrapperPass : public FunctionPass {