From: Christopher Tetreault Date: Wed, 15 Apr 2020 22:16:17 +0000 (-0700) Subject: [SVE] Fix unsigned is always >= 0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=464a0697e36ae84c4292402c7774c6ec6e93a438;p=platform%2Fupstream%2Fllvm.git [SVE] Fix unsigned is always >= 0 Reviewers: efriedma, sdesmalen Reviewed By: sdesmalen Subscribers: tschuett, rkruppe, psnobl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78131 --- diff --git a/clang/utils/TableGen/SveEmitter.cpp b/clang/utils/TableGen/SveEmitter.cpp index 5f9f5d5..79258a8 100644 --- a/clang/utils/TableGen/SveEmitter.cpp +++ b/clang/utils/TableGen/SveEmitter.cpp @@ -801,9 +801,10 @@ void SVEEmitter::createIntrinsic( // Collate a list of range/option checks for the immediates. SmallVector ImmChecks; for (auto *R : ImmCheckList) { - unsigned Arg = R->getValueAsInt("Arg"); - unsigned EltSizeArg = R->getValueAsInt("EltSizeArg"); - unsigned Kind = R->getValueAsDef("Kind")->getValueAsInt("Value"); + int64_t Arg = R->getValueAsInt("Arg"); + int64_t EltSizeArg = R->getValueAsInt("EltSizeArg"); + int64_t Kind = R->getValueAsDef("Kind")->getValueAsInt("Value"); + assert(Arg >= 0 && Kind >= 0 && "Arg and Kind must be nonnegative"); unsigned ElementSizeInBits = 0; if (EltSizeArg >= 0)