diff options
author | Nikita Popov <npopov@redhat.com> | 2023-11-14 09:25:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 09:25:14 +0100 |
commit | 56c1d30183e156365f7057f5945b2bc48fdb32e7 (patch) | |
tree | 0d0886c0e43529c72a31c6f26a30d3e004528132 /llvm/lib/AsmParser/LLParser.cpp | |
parent | 9cb1673fa5d267148ac81ee31b37f1d2f7c0f2b8 (diff) | |
download | llvm-56c1d30183e156365f7057f5945b2bc48fdb32e7.zip llvm-56c1d30183e156365f7057f5945b2bc48fdb32e7.tar.gz llvm-56c1d30183e156365f7057f5945b2bc48fdb32e7.tar.bz2 |
[IR] Remove support for lshr/ashr constant expressions (#71955)
Remove support for the lshr and ashr constant expressions. All places
creating them have been removed beforehand, so this just removes the
APIs and uses of these constant expressions in tests.
This is part of
https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179.
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 9940bfb..f9df70f 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -3852,6 +3852,10 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { return error(ID.Loc, "and constexprs are no longer supported"); case lltok::kw_or: return error(ID.Loc, "or constexprs are no longer supported"); + case lltok::kw_lshr: + return error(ID.Loc, "lshr constexprs are no longer supported"); + case lltok::kw_ashr: + return error(ID.Loc, "ashr constexprs are no longer supported"); case lltok::kw_fneg: return error(ID.Loc, "fneg constexprs are no longer supported"); case lltok::kw_select: @@ -3910,12 +3914,9 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { case lltok::kw_sub: case lltok::kw_mul: case lltok::kw_shl: - case lltok::kw_lshr: - case lltok::kw_ashr: case lltok::kw_xor: { bool NUW = false; bool NSW = false; - bool Exact = false; unsigned Opc = Lex.getUIntVal(); Constant *Val0, *Val1; Lex.Lex(); @@ -3928,10 +3929,6 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { if (EatIfPresent(lltok::kw_nuw)) NUW = true; } - } else if (Opc == Instruction::SDiv || Opc == Instruction::UDiv || - Opc == Instruction::LShr || Opc == Instruction::AShr) { - if (EatIfPresent(lltok::kw_exact)) - Exact = true; } if (parseToken(lltok::lparen, "expected '(' in binary constantexpr") || parseGlobalTypeAndValue(Val0) || @@ -3948,7 +3945,6 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) { unsigned Flags = 0; if (NUW) Flags |= OverflowingBinaryOperator::NoUnsignedWrap; if (NSW) Flags |= OverflowingBinaryOperator::NoSignedWrap; - if (Exact) Flags |= PossiblyExactOperator::IsExact; ID.ConstantVal = ConstantExpr::get(Opc, Val0, Val1, Flags); ID.Kind = ValID::t_Constant; return false; |