Skip to content

Commit e4a4122

Browse files
authored
[IR] Remove zext and sext constant expressions (#71040)
Remove support for zext and sext constant expressions. All places creating them have been removed beforehand, so this just removes the APIs and uses of these constant expressions in tests. There is some additional cleanup that can be done on top of this, e.g. we can remove the ZExtInst vs ZExtOperator footgun. This is part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179.
1 parent e9db60c commit e4a4122

File tree

62 files changed

+347
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+347
-502
lines changed

llvm/bindings/ocaml/llvm/llvm.ml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,6 @@ external const_gep : lltype -> llvalue -> llvalue array -> llvalue
661661
external const_in_bounds_gep : lltype -> llvalue -> llvalue array -> llvalue
662662
= "llvm_const_in_bounds_gep"
663663
external const_trunc : llvalue -> lltype -> llvalue = "llvm_const_trunc"
664-
external const_sext : llvalue -> lltype -> llvalue = "llvm_const_sext"
665-
external const_zext : llvalue -> lltype -> llvalue = "llvm_const_zext"
666664
external const_fptrunc : llvalue -> lltype -> llvalue = "llvm_const_fptrunc"
667665
external const_fpext : llvalue -> lltype -> llvalue = "llvm_const_fpext"
668666
external const_uitofp : llvalue -> lltype -> llvalue = "llvm_const_uitofp"
@@ -672,16 +670,10 @@ external const_fptosi : llvalue -> lltype -> llvalue = "llvm_const_fptosi"
672670
external const_ptrtoint : llvalue -> lltype -> llvalue = "llvm_const_ptrtoint"
673671
external const_inttoptr : llvalue -> lltype -> llvalue = "llvm_const_inttoptr"
674672
external const_bitcast : llvalue -> lltype -> llvalue = "llvm_const_bitcast"
675-
external const_zext_or_bitcast : llvalue -> lltype -> llvalue
676-
= "llvm_const_zext_or_bitcast"
677-
external const_sext_or_bitcast : llvalue -> lltype -> llvalue
678-
= "llvm_const_sext_or_bitcast"
679673
external const_trunc_or_bitcast : llvalue -> lltype -> llvalue
680674
= "llvm_const_trunc_or_bitcast"
681675
external const_pointercast : llvalue -> lltype -> llvalue
682676
= "llvm_const_pointercast"
683-
external const_intcast : llvalue -> lltype -> is_signed:bool -> llvalue
684-
= "llvm_const_intcast"
685677
external const_fpcast : llvalue -> lltype -> llvalue = "llvm_const_fpcast"
686678
external const_extractelement : llvalue -> llvalue -> llvalue
687679
= "llvm_const_extractelement"

llvm/bindings/ocaml/llvm/llvm.mli

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,16 +1171,6 @@ val const_in_bounds_gep : lltype -> llvalue -> llvalue array -> llvalue
11711171
See the method [llvm::ConstantExpr::getTrunc]. *)
11721172
val const_trunc : llvalue -> lltype -> llvalue
11731173

1174-
(** [const_sext c ty] returns the constant sign extension of integer constant
1175-
[c] to the larger integer type [ty].
1176-
See the method [llvm::ConstantExpr::getSExt]. *)
1177-
val const_sext : llvalue -> lltype -> llvalue
1178-
1179-
(** [const_zext c ty] returns the constant zero extension of integer constant
1180-
[c] to the larger integer type [ty].
1181-
See the method [llvm::ConstantExpr::getZExt]. *)
1182-
val const_zext : llvalue -> lltype -> llvalue
1183-
11841174
(** [const_fptrunc c ty] returns the constant truncation of floating point
11851175
constant [c] to the smaller floating point type [ty].
11861176
See the method [llvm::ConstantExpr::getFPTrunc]. *)
@@ -1226,16 +1216,6 @@ val const_inttoptr : llvalue -> lltype -> llvalue
12261216
See the method [llvm::ConstantExpr::getBitCast]. *)
12271217
val const_bitcast : llvalue -> lltype -> llvalue
12281218

1229-
(** [const_zext_or_bitcast c ty] returns a constant zext or bitwise cast
1230-
conversion of constant [c] to type [ty].
1231-
See the method [llvm::ConstantExpr::getZExtOrBitCast]. *)
1232-
val const_zext_or_bitcast : llvalue -> lltype -> llvalue
1233-
1234-
(** [const_sext_or_bitcast c ty] returns a constant sext or bitwise cast
1235-
conversion of constant [c] to type [ty].
1236-
See the method [llvm::ConstantExpr::getSExtOrBitCast]. *)
1237-
val const_sext_or_bitcast : llvalue -> lltype -> llvalue
1238-
12391219
(** [const_trunc_or_bitcast c ty] returns a constant trunc or bitwise cast
12401220
conversion of constant [c] to type [ty].
12411221
See the method [llvm::ConstantExpr::getTruncOrBitCast]. *)
@@ -1246,13 +1226,6 @@ val const_trunc_or_bitcast : llvalue -> lltype -> llvalue
12461226
See the method [llvm::ConstantExpr::getPointerCast]. *)
12471227
val const_pointercast : llvalue -> lltype -> llvalue
12481228

1249-
(** [const_intcast c ty ~is_signed] returns a constant sext/zext, bitcast,
1250-
or trunc for integer -> integer casts of constant [c] to type [ty].
1251-
When converting a narrower value to a wider one, whether sext or zext
1252-
will be used is controlled by [is_signed].
1253-
See the method [llvm::ConstantExpr::getIntegerCast]. *)
1254-
val const_intcast : llvalue -> lltype -> is_signed:bool -> llvalue
1255-
12561229
(** [const_fpcast c ty] returns a constant fpext, bitcast, or fptrunc for fp ->
12571230
fp casts of constant [c] to type [ty].
12581231
See the method [llvm::ConstantExpr::getFPCast]. *)

llvm/bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,18 +1271,6 @@ value llvm_const_trunc(value CV, value T) {
12711271
return to_val(Value);
12721272
}
12731273

1274-
/* llvalue -> lltype -> llvalue */
1275-
value llvm_const_sext(value CV, value T) {
1276-
LLVMValueRef Value = LLVMConstSExt(Value_val(CV), Type_val(T));
1277-
return to_val(Value);
1278-
}
1279-
1280-
/* llvalue -> lltype -> llvalue */
1281-
value llvm_const_zext(value CV, value T) {
1282-
LLVMValueRef Value = LLVMConstZExt(Value_val(CV), Type_val(T));
1283-
return to_val(Value);
1284-
}
1285-
12861274
/* llvalue -> lltype -> llvalue */
12871275
value llvm_const_fptrunc(value CV, value T) {
12881276
LLVMValueRef Value = LLVMConstFPTrunc(Value_val(CV), Type_val(T));
@@ -1337,18 +1325,6 @@ value llvm_const_bitcast(value CV, value T) {
13371325
return to_val(Value);
13381326
}
13391327

1340-
/* llvalue -> lltype -> llvalue */
1341-
value llvm_const_zext_or_bitcast(value CV, value T) {
1342-
LLVMValueRef Value = LLVMConstZExtOrBitCast(Value_val(CV), Type_val(T));
1343-
return to_val(Value);
1344-
}
1345-
1346-
/* llvalue -> lltype -> llvalue */
1347-
value llvm_const_sext_or_bitcast(value CV, value T) {
1348-
LLVMValueRef Value = LLVMConstSExtOrBitCast(Value_val(CV), Type_val(T));
1349-
return to_val(Value);
1350-
}
1351-
13521328
/* llvalue -> lltype -> llvalue */
13531329
value llvm_const_trunc_or_bitcast(value CV, value T) {
13541330
LLVMValueRef Value = LLVMConstTruncOrBitCast(Value_val(CV), Type_val(T));
@@ -1361,12 +1337,6 @@ value llvm_const_pointercast(value CV, value T) {
13611337
return to_val(Value);
13621338
}
13631339

1364-
/* llvalue -> lltype -> is_signed:bool -> llvalue */
1365-
value llvm_const_intcast(value CV, value T, value IsSigned) {
1366-
return to_val(
1367-
LLVMConstIntCast(Value_val(CV), Type_val(T), Bool_val(IsSigned)));
1368-
}
1369-
13701340
/* llvalue -> lltype -> llvalue */
13711341
value llvm_const_fpcast(value CV, value T) {
13721342
LLVMValueRef Value = LLVMConstFPCast(Value_val(CV), Type_val(T));

llvm/docs/LangRef.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4657,10 +4657,6 @@ The following is the syntax for constant expressions:
46574657

46584658
``trunc (CST to TYPE)``
46594659
Perform the :ref:`trunc operation <i_trunc>` on constants.
4660-
``zext (CST to TYPE)``
4661-
Perform the :ref:`zext operation <i_zext>` on constants.
4662-
``sext (CST to TYPE)``
4663-
Perform the :ref:`sext operation <i_sext>` on constants.
46644660
``fptrunc (CST to TYPE)``
46654661
Truncate a floating-point constant to another floating-point type.
46664662
The size of CST must be larger than the size of TYPE. Both types

llvm/docs/ReleaseNotes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Changes to the LLVM IR
5757

5858
* ``and``
5959
* ``or``
60+
* ``zext``
61+
* ``sext``
6062

6163
* Added `llvm.exp10` intrinsic.
6264

@@ -166,6 +168,11 @@ Changes to the C API
166168

167169
* ``LLVMConstAnd``
168170
* ``LLVMConstOr``
171+
* ``LLVMConstZExt``
172+
* ``LLVMConstSExt``
173+
* ``LLVMConstZExtOrBitCast``
174+
* ``LLVMConstSExtOrBitCast``
175+
* ``LLVMConstIntCast``
169176

170177
* Added ``LLVMCreateTargetMachineWithOptions``, along with helper functions for
171178
an opaque option structure, as an alternative to ``LLVMCreateTargetMachine``.

llvm/include/llvm-c/Core.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,8 +2290,6 @@ LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
22902290
LLVMValueRef *ConstantIndices,
22912291
unsigned NumIndices);
22922292
LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
2293-
LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
2294-
LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
22952293
LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
22962294
LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
22972295
LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
@@ -2302,16 +2300,10 @@ LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
23022300
LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
23032301
LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
23042302
LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
2305-
LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal,
2306-
LLVMTypeRef ToType);
2307-
LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal,
2308-
LLVMTypeRef ToType);
23092303
LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,
23102304
LLVMTypeRef ToType);
23112305
LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
23122306
LLVMTypeRef ToType);
2313-
LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
2314-
LLVMBool isSigned);
23152307
LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
23162308
LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
23172309
LLVMValueRef IndexConstant);

llvm/include/llvm/IR/Constants.h

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,6 @@ class ConstantExpr : public Constant {
10411041
static Constant *getLShr(Constant *C1, Constant *C2, bool isExact = false);
10421042
static Constant *getAShr(Constant *C1, Constant *C2, bool isExact = false);
10431043
static Constant *getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced = false);
1044-
static Constant *getSExt(Constant *C, Type *Ty, bool OnlyIfReduced = false);
1045-
static Constant *getZExt(Constant *C, Type *Ty, bool OnlyIfReduced = false);
10461044
static Constant *getFPTrunc(Constant *C, Type *Ty,
10471045
bool OnlyIfReduced = false);
10481046
static Constant *getFPExtend(Constant *C, Type *Ty,
@@ -1140,29 +1138,12 @@ class ConstantExpr : public Constant {
11401138
static Constant *getCast(unsigned ops, Constant *C, Type *Ty,
11411139
bool OnlyIfReduced = false);
11421140

1143-
// Create a ZExt or BitCast cast constant expression
1144-
static Constant *
1145-
getZExtOrBitCast(Constant *C, ///< The constant to zext or bitcast
1146-
Type *Ty ///< The type to zext or bitcast C to
1147-
);
1148-
1149-
// Create a SExt or BitCast cast constant expression
1150-
static Constant *
1151-
getSExtOrBitCast(Constant *C, ///< The constant to sext or bitcast
1152-
Type *Ty ///< The type to sext or bitcast C to
1153-
);
1154-
11551141
// Create a Trunc or BitCast cast constant expression
11561142
static Constant *
11571143
getTruncOrBitCast(Constant *C, ///< The constant to trunc or bitcast
11581144
Type *Ty ///< The type to trunc or bitcast C to
11591145
);
11601146

1161-
/// Create either an sext, trunc or nothing, depending on whether Ty is
1162-
/// wider, narrower or the same as C->getType(). This only works with
1163-
/// integer or vector of integer types.
1164-
static Constant *getSExtOrTrunc(Constant *C, Type *Ty);
1165-
11661147
/// Create a BitCast, AddrSpaceCast, or a PtrToInt cast constant
11671148
/// expression.
11681149
static Constant *
@@ -1177,13 +1158,6 @@ class ConstantExpr : public Constant {
11771158
Type *Ty ///< The type to bitcast or addrspacecast C to
11781159
);
11791160

1180-
/// Create a ZExt, Bitcast or Trunc for integer -> integer casts
1181-
static Constant *
1182-
getIntegerCast(Constant *C, ///< The integer constant to be casted
1183-
Type *Ty, ///< The integer type to cast to
1184-
bool IsSigned ///< Whether C should be treated as signed or not
1185-
);
1186-
11871161
/// Create a FPExt, Bitcast or FPTrunc for fp -> fp casts
11881162
static Constant *getFPCast(Constant *C, ///< The integer constant to be casted
11891163
Type *Ty ///< The integer type to cast to
@@ -1333,6 +1307,9 @@ class ConstantExpr : public Constant {
13331307
/// Whether creating a constant expression for this cast is desirable.
13341308
static bool isDesirableCastOp(unsigned Opcode);
13351309

1310+
/// Whether creating a constant expression for this cast is supported.
1311+
static bool isSupportedCastOp(unsigned Opcode);
1312+
13361313
/// Whether creating a constant expression for this getelementptr type is
13371314
/// supported.
13381315
static bool isSupportedGetElementPtr(const Type *SrcElemTy) {

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3805,8 +3805,6 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
38053805
}
38063806

38073807
case lltok::kw_trunc:
3808-
case lltok::kw_zext:
3809-
case lltok::kw_sext:
38103808
case lltok::kw_fptrunc:
38113809
case lltok::kw_fpext:
38123810
case lltok::kw_bitcast:
@@ -3866,6 +3864,10 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
38663864
return error(ID.Loc, "fneg constexprs are no longer supported");
38673865
case lltok::kw_select:
38683866
return error(ID.Loc, "select constexprs are no longer supported");
3867+
case lltok::kw_zext:
3868+
return error(ID.Loc, "zext constexprs are no longer supported");
3869+
case lltok::kw_sext:
3870+
return error(ID.Loc, "sext constexprs are no longer supported");
38693871
case lltok::kw_icmp:
38703872
case lltok::kw_fcmp: {
38713873
unsigned PredVal, Opc = Lex.getUIntVal();

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,9 @@ static bool isConstExprSupported(const BitcodeConstant *BC) {
13941394
if (Instruction::isBinaryOp(Opcode))
13951395
return ConstantExpr::isSupportedBinOp(Opcode);
13961396

1397+
if (Instruction::isCast(Opcode))
1398+
return ConstantExpr::isSupportedCastOp(Opcode);
1399+
13971400
if (Opcode == Instruction::GetElementPtr)
13981401
return ConstantExpr::isSupportedGetElementPtr(BC->SrcElemTy);
13991402

llvm/lib/IR/ConstantFold.cpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -258,40 +258,6 @@ static Constant *ExtractConstantBytes(Constant *C, unsigned ByteStart,
258258
// TODO: Handle the 'partially zero' case.
259259
return nullptr;
260260
}
261-
262-
case Instruction::ZExt: {
263-
unsigned SrcBitSize =
264-
cast<IntegerType>(CE->getOperand(0)->getType())->getBitWidth();
265-
266-
// If extracting something that is completely zero, return 0.
267-
if (ByteStart*8 >= SrcBitSize)
268-
return Constant::getNullValue(IntegerType::get(CE->getContext(),
269-
ByteSize*8));
270-
271-
// If exactly extracting the input, return it.
272-
if (ByteStart == 0 && ByteSize*8 == SrcBitSize)
273-
return CE->getOperand(0);
274-
275-
// If extracting something completely in the input, if the input is a
276-
// multiple of 8 bits, recurse.
277-
if ((SrcBitSize&7) == 0 && (ByteStart+ByteSize)*8 <= SrcBitSize)
278-
return ExtractConstantBytes(CE->getOperand(0), ByteStart, ByteSize);
279-
280-
// Otherwise, if extracting a subset of the input, which is not multiple of
281-
// 8 bits, do a shift and trunc to get the bits.
282-
if ((ByteStart+ByteSize)*8 < SrcBitSize) {
283-
assert((SrcBitSize&7) && "Shouldn't get byte sized case here");
284-
Constant *Res = CE->getOperand(0);
285-
if (ByteStart)
286-
Res = ConstantExpr::getLShr(Res,
287-
ConstantInt::get(Res->getType(), ByteStart*8));
288-
return ConstantExpr::getTrunc(Res, IntegerType::get(C->getContext(),
289-
ByteSize*8));
290-
}
291-
292-
// TODO: Handle the 'partially zero' case.
293-
return nullptr;
294-
}
295261
}
296262
}
297263

@@ -986,16 +952,6 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1,
986952
return C1; // X & -1 == X
987953

988954
if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) {
989-
// (zext i32 to i64) & 4294967295 -> (zext i32 to i64)
990-
if (CE1->getOpcode() == Instruction::ZExt) {
991-
unsigned DstWidth = CI2->getType()->getBitWidth();
992-
unsigned SrcWidth =
993-
CE1->getOperand(0)->getType()->getPrimitiveSizeInBits();
994-
APInt PossiblySetBits(APInt::getLowBitsSet(DstWidth, SrcWidth));
995-
if ((PossiblySetBits & CI2->getValue()) == PossiblySetBits)
996-
return C1;
997-
}
998-
999955
// If and'ing the address of a global with a constant, fold it.
1000956
if (CE1->getOpcode() == Instruction::PtrToInt &&
1001957
isa<GlobalValue>(CE1->getOperand(0))) {
@@ -1056,12 +1012,6 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1,
10561012
}
10571013
}
10581014
break;
1059-
case Instruction::AShr:
1060-
// ashr (zext C to Ty), C2 -> lshr (zext C, CSA), C2
1061-
if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1))
1062-
if (CE1->getOpcode() == Instruction::ZExt) // Top bits known zero.
1063-
return ConstantExpr::getLShr(C1, C2);
1064-
break;
10651015
}
10661016
} else if (isa<ConstantInt>(C1)) {
10671017
// If C1 is a ConstantInt and C2 is not, swap the operands.
@@ -1461,17 +1411,13 @@ static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2,
14611411
[[fallthrough]];
14621412
case Instruction::UIToFP:
14631413
case Instruction::SIToFP:
1464-
case Instruction::ZExt:
1465-
case Instruction::SExt:
14661414
// We can't evaluate floating point casts or truncations.
14671415
if (CE1Op0->getType()->isFPOrFPVectorTy())
14681416
break;
14691417

14701418
// If the cast is not actually changing bits, and the second operand is a
14711419
// null pointer, do the comparison with the pre-casted value.
14721420
if (V2->isNullValue() && CE1->getType()->isIntOrPtrTy()) {
1473-
if (CE1->getOpcode() == Instruction::ZExt) isSigned = false;
1474-
if (CE1->getOpcode() == Instruction::SExt) isSigned = true;
14751421
return evaluateICmpRelation(CE1Op0,
14761422
Constant::getNullValue(CE1Op0->getType()),
14771423
isSigned);
@@ -1828,24 +1774,6 @@ Constant *llvm::ConstantFoldCompareInstruction(CmpInst::Predicate Predicate,
18281774
}
18291775
}
18301776

1831-
// If the left hand side is an extension, try eliminating it.
1832-
if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) {
1833-
if ((CE1->getOpcode() == Instruction::SExt &&
1834-
ICmpInst::isSigned(Predicate)) ||
1835-
(CE1->getOpcode() == Instruction::ZExt &&
1836-
!ICmpInst::isSigned(Predicate))) {
1837-
Constant *CE1Op0 = CE1->getOperand(0);
1838-
Constant *CE1Inverse = ConstantExpr::getTrunc(CE1, CE1Op0->getType());
1839-
if (CE1Inverse == CE1Op0) {
1840-
// Check whether we can safely truncate the right hand side.
1841-
Constant *C2Inverse = ConstantExpr::getTrunc(C2, CE1Op0->getType());
1842-
if (ConstantExpr::getCast(CE1->getOpcode(), C2Inverse,
1843-
C2->getType()) == C2)
1844-
return ConstantExpr::getICmp(Predicate, CE1Inverse, C2Inverse);
1845-
}
1846-
}
1847-
}
1848-
18491777
if ((!isa<ConstantExpr>(C1) && isa<ConstantExpr>(C2)) ||
18501778
(C1->isNullValue() && !C2->isNullValue())) {
18511779
// If C2 is a constant expr and C1 isn't, flip them around and fold the

0 commit comments

Comments
 (0)