Update prebuilt Clang to r365631c1 from Android.
The version we had was segfaulting.
Bug: 132420445
Change-Id: Icb45a6fe0b4e2166f7895e669df1157cec9fb4e0
diff --git a/linux-x64/clang/include/llvm/IR/PatternMatch.h b/linux-x64/clang/include/llvm/IR/PatternMatch.h
index 6c51d48..1a11af2 100644
--- a/linux-x64/clang/include/llvm/IR/PatternMatch.h
+++ b/linux-x64/clang/include/llvm/IR/PatternMatch.h
@@ -418,6 +418,20 @@
return cst_pred_ty<is_lowbit_mask>();
}
+struct is_unsigned_less_than {
+ const APInt *Thr;
+ bool isValue(const APInt &C) { return C.ult(*Thr); }
+};
+/// Match an integer or vector with every element unsigned less than the
+/// Threshold. For vectors, this includes constants with undefined elements.
+/// FIXME: is it worth generalizing this to simply take ICmpInst::Predicate?
+inline cst_pred_ty<is_unsigned_less_than>
+m_SpecificInt_ULT(const APInt &Threshold) {
+ cst_pred_ty<is_unsigned_less_than> P;
+ P.Thr = &Threshold;
+ return P;
+}
+
struct is_nan {
bool isValue(const APFloat &C) { return C.isNaN(); }
};
@@ -667,18 +681,26 @@
FNeg_match(const Op_t &Op) : X(Op) {}
template <typename OpTy> bool match(OpTy *V) {
auto *FPMO = dyn_cast<FPMathOperator>(V);
- if (!FPMO || FPMO->getOpcode() != Instruction::FSub)
- return false;
- if (FPMO->hasNoSignedZeros()) {
- // With 'nsz', any zero goes.
- if (!cstfp_pred_ty<is_any_zero_fp>().match(FPMO->getOperand(0)))
- return false;
- } else {
- // Without 'nsz', we need fsub -0.0, X exactly.
- if (!cstfp_pred_ty<is_neg_zero_fp>().match(FPMO->getOperand(0)))
- return false;
+ if (!FPMO) return false;
+
+ if (FPMO->getOpcode() == Instruction::FNeg)
+ return X.match(FPMO->getOperand(0));
+
+ if (FPMO->getOpcode() == Instruction::FSub) {
+ if (FPMO->hasNoSignedZeros()) {
+ // With 'nsz', any zero goes.
+ if (!cstfp_pred_ty<is_any_zero_fp>().match(FPMO->getOperand(0)))
+ return false;
+ } else {
+ // Without 'nsz', we need fsub -0.0, X exactly.
+ if (!cstfp_pred_ty<is_neg_zero_fp>().match(FPMO->getOperand(0)))
+ return false;
+ }
+
+ return X.match(FPMO->getOperand(1));
}
- return X.match(FPMO->getOperand(1));
+
+ return false;
}
};