Skip to content

Commit a2a156a

Browse files
author
MUSTAPHA BARKI
authored
Merge branch 'main' into Uncontrolled-data-used-in-path-expression
2 parents ffa84d3 + e25be77 commit a2a156a

File tree

22 files changed

+296
-205
lines changed

22 files changed

+296
-205
lines changed

clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import json
2727
import multiprocessing
2828
import os
29-
import Queue
29+
from queue import Queue
3030
import shutil
3131
import subprocess
3232
import sys
@@ -105,7 +105,7 @@ def main():
105105

106106
try:
107107
# Spin up a bunch of tidy-launching threads.
108-
queue = Queue.Queue(max_task)
108+
queue = Queue(max_task)
109109
for _ in range(max_task):
110110
t = threading.Thread(
111111
target=run_find_all_symbols, args=(args, tmpdir, build_path, queue)

clang/lib/AST/ASTContext.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5873,8 +5873,14 @@ ASTContext::getSubstBuiltinTemplatePack(const TemplateArgument &ArgPack) {
58735873

58745874
QualType Canon;
58755875
TemplateArgument CanonArgPack = getCanonicalTemplateArgument(ArgPack);
5876-
if (!CanonArgPack.structurallyEquals(ArgPack))
5876+
if (!CanonArgPack.structurallyEquals(ArgPack)) {
58775877
Canon = getSubstBuiltinTemplatePack(CanonArgPack);
5878+
// Refresh InsertPos, in case the recursive call above caused rehashing,
5879+
// which would invalidate the bucket pointer.
5880+
[[maybe_unused]] const auto *Nothing =
5881+
SubstBuiltinTemplatePackTypes.FindNodeOrInsertPos(ID, InsertPos);
5882+
assert(!Nothing);
5883+
}
58785884

58795885
auto *PackType = new (*this, alignof(SubstBuiltinTemplatePackType))
58805886
SubstBuiltinTemplatePackType(Canon, ArgPack);

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 31 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,9 @@ static bool interp_floating_comparison(InterpState &S, CodePtr OpPC,
563563
case Builtin::BI__builtin_islessequal:
564564
return LHS <= RHS;
565565
case Builtin::BI__builtin_islessgreater: {
566-
ComparisonCategoryResult cmp = LHS.compare(RHS);
567-
return cmp == ComparisonCategoryResult::Less ||
568-
cmp == ComparisonCategoryResult::Greater;
566+
ComparisonCategoryResult Cmp = LHS.compare(RHS);
567+
return Cmp == ComparisonCategoryResult::Less ||
568+
Cmp == ComparisonCategoryResult::Greater;
569569
}
570570
case Builtin::BI__builtin_isunordered:
571571
return LHS.compare(RHS) == ComparisonCategoryResult::Unordered;
@@ -583,8 +583,7 @@ static bool interp_floating_comparison(InterpState &S, CodePtr OpPC,
583583
static bool interp__builtin_isfpclass(InterpState &S, CodePtr OpPC,
584584
const InterpFrame *Frame,
585585
const CallExpr *Call) {
586-
PrimType FPClassArgT = *S.getContext().classify(Call->getArg(1)->getType());
587-
APSInt FPClassArg = popToAPSInt(S.Stk, FPClassArgT);
586+
APSInt FPClassArg = popToAPSInt(S, Call->getArg(1));
588587
const Floating &F = S.Stk.pop<Floating>();
589588

590589
int32_t Result = static_cast<int32_t>(
@@ -655,8 +654,7 @@ static bool interp__builtin_fabs(InterpState &S, CodePtr OpPC,
655654
static bool interp__builtin_abs(InterpState &S, CodePtr OpPC,
656655
const InterpFrame *Frame,
657656
const CallExpr *Call) {
658-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
659-
APSInt Val = popToAPSInt(S.Stk, ArgT);
657+
APSInt Val = popToAPSInt(S, Call->getArg(0));
660658
if (Val ==
661659
APSInt(APInt::getSignedMinValue(Val.getBitWidth()), /*IsUnsigned=*/false))
662660
return false;
@@ -674,8 +672,7 @@ static bool interp__builtin_popcount(InterpState &S, CodePtr OpPC,
674672
const Pointer &Arg = S.Stk.pop<Pointer>();
675673
Val = convertBoolVectorToInt(Arg);
676674
} else {
677-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
678-
Val = popToAPSInt(S.Stk, ArgT);
675+
Val = popToAPSInt(S, Call->getArg(0));
679676
}
680677
pushInteger(S, Val.popcount(), Call->getType());
681678
return true;
@@ -684,26 +681,23 @@ static bool interp__builtin_popcount(InterpState &S, CodePtr OpPC,
684681
static bool interp__builtin_parity(InterpState &S, CodePtr OpPC,
685682
const InterpFrame *Frame,
686683
const CallExpr *Call) {
687-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
688-
APSInt Val = popToAPSInt(S.Stk, ArgT);
684+
APSInt Val = popToAPSInt(S, Call->getArg(0));
689685
pushInteger(S, Val.popcount() % 2, Call->getType());
690686
return true;
691687
}
692688

693689
static bool interp__builtin_clrsb(InterpState &S, CodePtr OpPC,
694690
const InterpFrame *Frame,
695691
const CallExpr *Call) {
696-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
697-
APSInt Val = popToAPSInt(S.Stk, ArgT);
692+
APSInt Val = popToAPSInt(S, Call->getArg(0));
698693
pushInteger(S, Val.getBitWidth() - Val.getSignificantBits(), Call->getType());
699694
return true;
700695
}
701696

702697
static bool interp__builtin_bitreverse(InterpState &S, CodePtr OpPC,
703698
const InterpFrame *Frame,
704699
const CallExpr *Call) {
705-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
706-
APSInt Val = popToAPSInt(S.Stk, ArgT);
700+
APSInt Val = popToAPSInt(S, Call->getArg(0));
707701
pushInteger(S, Val.reverseBits(), Call->getType());
708702
return true;
709703
}
@@ -746,11 +740,8 @@ static bool interp__builtin_expect(InterpState &S, CodePtr OpPC,
746740
static bool interp__builtin_rotate(InterpState &S, CodePtr OpPC,
747741
const InterpFrame *Frame,
748742
const CallExpr *Call, bool Right) {
749-
PrimType AmountT = *S.getContext().classify(Call->getArg(1)->getType());
750-
PrimType ValueT = *S.getContext().classify(Call->getArg(0)->getType());
751-
752-
APSInt Amount = popToAPSInt(S.Stk, AmountT);
753-
APSInt Value = popToAPSInt(S.Stk, ValueT);
743+
APSInt Amount = popToAPSInt(S, Call->getArg(1));
744+
APSInt Value = popToAPSInt(S, Call->getArg(0));
754745

755746
APSInt Result;
756747
if (Right)
@@ -767,8 +758,7 @@ static bool interp__builtin_rotate(InterpState &S, CodePtr OpPC,
767758
static bool interp__builtin_ffs(InterpState &S, CodePtr OpPC,
768759
const InterpFrame *Frame,
769760
const CallExpr *Call) {
770-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
771-
APSInt Value = popToAPSInt(S.Stk, ArgT);
761+
APSInt Value = popToAPSInt(S, Call->getArg(0));
772762

773763
uint64_t N = Value.countr_zero();
774764
pushInteger(S, N == Value.getBitWidth() ? 0 : N + 1, Call->getType());
@@ -796,8 +786,7 @@ static bool interp__builtin_move(InterpState &S, CodePtr OpPC,
796786
static bool interp__builtin_eh_return_data_regno(InterpState &S, CodePtr OpPC,
797787
const InterpFrame *Frame,
798788
const CallExpr *Call) {
799-
PrimType ArgT = *S.getContext().classify(Call->getArg(0)->getType());
800-
APSInt Arg = popToAPSInt(S.Stk, ArgT);
789+
APSInt Arg = popToAPSInt(S, Call->getArg(0));
801790

802791
int Result = S.getASTContext().getTargetInfo().getEHDataRegisterNumber(
803792
Arg.getZExtValue());
@@ -971,17 +960,15 @@ static bool interp__builtin_clz(InterpState &S, CodePtr OpPC,
971960
unsigned BuiltinOp) {
972961

973962
std::optional<APSInt> Fallback;
974-
if (BuiltinOp == Builtin::BI__builtin_clzg && Call->getNumArgs() == 2) {
975-
PrimType FallbackT = *S.getContext().classify(Call->getArg(1));
976-
Fallback = popToAPSInt(S.Stk, FallbackT);
977-
}
963+
if (BuiltinOp == Builtin::BI__builtin_clzg && Call->getNumArgs() == 2)
964+
Fallback = popToAPSInt(S, Call->getArg(1));
965+
978966
APSInt Val;
979967
if (Call->getArg(0)->getType()->isExtVectorBoolType()) {
980968
const Pointer &Arg = S.Stk.pop<Pointer>();
981969
Val = convertBoolVectorToInt(Arg);
982970
} else {
983-
PrimType ValT = *S.getContext().classify(Call->getArg(0));
984-
Val = popToAPSInt(S.Stk, ValT);
971+
Val = popToAPSInt(S, Call->getArg(0));
985972
}
986973

987974
// When the argument is 0, the result of GCC builtins is undefined, whereas
@@ -1008,17 +995,15 @@ static bool interp__builtin_ctz(InterpState &S, CodePtr OpPC,
1008995
const InterpFrame *Frame, const CallExpr *Call,
1009996
unsigned BuiltinID) {
1010997
std::optional<APSInt> Fallback;
1011-
if (BuiltinID == Builtin::BI__builtin_ctzg && Call->getNumArgs() == 2) {
1012-
PrimType FallbackT = *S.getContext().classify(Call->getArg(1));
1013-
Fallback = popToAPSInt(S.Stk, FallbackT);
1014-
}
998+
if (BuiltinID == Builtin::BI__builtin_ctzg && Call->getNumArgs() == 2)
999+
Fallback = popToAPSInt(S, Call->getArg(1));
1000+
10151001
APSInt Val;
10161002
if (Call->getArg(0)->getType()->isExtVectorBoolType()) {
10171003
const Pointer &Arg = S.Stk.pop<Pointer>();
10181004
Val = convertBoolVectorToInt(Arg);
10191005
} else {
1020-
PrimType ValT = *S.getContext().classify(Call->getArg(0));
1021-
Val = popToAPSInt(S.Stk, ValT);
1006+
Val = popToAPSInt(S, Call->getArg(0));
10221007
}
10231008

10241009
if (Val == 0) {
@@ -1036,13 +1021,10 @@ static bool interp__builtin_ctz(InterpState &S, CodePtr OpPC,
10361021
static bool interp__builtin_bswap(InterpState &S, CodePtr OpPC,
10371022
const InterpFrame *Frame,
10381023
const CallExpr *Call) {
1039-
PrimType ReturnT = *S.getContext().classify(Call->getType());
1040-
PrimType ValT = *S.getContext().classify(Call->getArg(0));
1041-
const APSInt &Val = popToAPSInt(S.Stk, ValT);
1024+
const APSInt &Val = popToAPSInt(S, Call->getArg(0));
10421025
assert(Val.getActiveBits() <= 64);
10431026

1044-
INT_TYPE_SWITCH(ReturnT,
1045-
{ S.Stk.push<T>(T::from(Val.byteSwap().getZExtValue())); });
1027+
pushInteger(S, Val.byteSwap(), Call->getType());
10461028
return true;
10471029
}
10481030

@@ -1057,9 +1039,8 @@ static bool interp__builtin_atomic_lock_free(InterpState &S, CodePtr OpPC,
10571039
return true;
10581040
};
10591041

1060-
PrimType ValT = *S.getContext().classify(Call->getArg(0));
10611042
const Pointer &Ptr = S.Stk.pop<Pointer>();
1062-
const APSInt &SizeVal = popToAPSInt(S.Stk, ValT);
1043+
const APSInt &SizeVal = popToAPSInt(S, Call->getArg(0));
10631044

10641045
// For __atomic_is_lock_free(sizeof(_Atomic(T))), if the size is a power
10651046
// of two less than or equal to the maximum inline atomic width, we know it
@@ -1125,21 +1106,17 @@ static bool interp__builtin_c11_atomic_is_lock_free(InterpState &S,
11251106
CodePtr OpPC,
11261107
const InterpFrame *Frame,
11271108
const CallExpr *Call) {
1128-
PrimType ValT = *S.getContext().classify(Call->getArg(0));
1129-
const APSInt &SizeVal = popToAPSInt(S.Stk, ValT);
1130-
1131-
auto returnBool = [&S](bool Value) -> bool {
1132-
S.Stk.push<Boolean>(Value);
1133-
return true;
1134-
};
1109+
const APSInt &SizeVal = popToAPSInt(S, Call->getArg(0));
11351110

11361111
CharUnits Size = CharUnits::fromQuantity(SizeVal.getZExtValue());
11371112
if (Size.isPowerOfTwo()) {
11381113
// Check against inlining width.
11391114
unsigned InlineWidthBits =
11401115
S.getASTContext().getTargetInfo().getMaxAtomicInlineWidth();
1141-
if (Size <= S.getASTContext().toCharUnitsFromBits(InlineWidthBits))
1142-
return returnBool(true);
1116+
if (Size <= S.getASTContext().toCharUnitsFromBits(InlineWidthBits)) {
1117+
S.Stk.push<Boolean>(true);
1118+
return true;
1119+
}
11431120
}
11441121

11451122
return false; // returnBool(false);
@@ -1324,10 +1301,8 @@ static bool interp__builtin_ia32_bextr(InterpState &S, CodePtr OpPC,
13241301
!Call->getArg(1)->getType()->isIntegerType())
13251302
return false;
13261303

1327-
PrimType ValT = *S.Ctx.classify(Call->getArg(0));
1328-
PrimType IndexT = *S.Ctx.classify(Call->getArg(1));
1329-
APSInt Index = popToAPSInt(S.Stk, IndexT);
1330-
APSInt Val = popToAPSInt(S.Stk, ValT);
1304+
APSInt Index = popToAPSInt(S, Call->getArg(1));
1305+
APSInt Val = popToAPSInt(S, Call->getArg(0));
13311306

13321307
unsigned BitWidth = Val.getBitWidth();
13331308
uint64_t Shift = Index.extractBitsAsZExtValue(8, 0);

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,7 @@ mlir::Value ScalarExprEmitter::emitPromoted(const Expr *e,
12781278
"ScalarExprEmitter::emitPromoted unary imag");
12791279
return {};
12801280
case UO_Real:
1281-
cgf.cgm.errorNYI(e->getSourceRange(),
1282-
"ScalarExprEmitter::emitPromoted unary real");
1283-
return {};
1281+
return VisitRealImag(uo, promotionType);
12841282
case UO_Minus:
12851283
return emitUnaryPlusOrMinus(uo, cir::UnaryOpKind::Minus, promotionType);
12861284
case UO_Plus:
@@ -2087,9 +2085,13 @@ mlir::Value ScalarExprEmitter::VisitUnaryLNot(const UnaryOperator *e) {
20872085
if (e->getType()->isVectorType() &&
20882086
e->getType()->castAs<VectorType>()->getVectorKind() ==
20892087
VectorKind::Generic) {
2090-
assert(!cir::MissingFeatures::vectorType());
2091-
cgf.cgm.errorNYI(e->getSourceRange(), "vector logical not");
2092-
return {};
2088+
mlir::Value oper = Visit(e->getSubExpr());
2089+
mlir::Location loc = cgf.getLoc(e->getExprLoc());
2090+
auto operVecTy = mlir::cast<cir::VectorType>(oper.getType());
2091+
auto exprVecTy = mlir::cast<cir::VectorType>(cgf.convertType(e->getType()));
2092+
mlir::Value zeroVec = builder.getNullValue(operVecTy, loc);
2093+
return cir::VecCmpOp::create(builder, loc, exprVecTy, cir::CmpOpKind::eq,
2094+
oper, zeroVec);
20932095
}
20942096

20952097
// Compare operand to zero.
@@ -2132,6 +2134,9 @@ mlir::Value ScalarExprEmitter::VisitRealImag(const UnaryOperator *e,
21322134
// this won't work for, e.g. an Obj-C property
21332135
mlir::Value complex = cgf.emitComplexExpr(op);
21342136
if (e->isGLValue() && !promotionTy.isNull()) {
2137+
promotionTy = promotionTy->isAnyComplexType()
2138+
? promotionTy
2139+
: cgf.getContext().getComplexType(promotionTy);
21352140
complex = cgf.emitPromotedValue(complex, promotionTy);
21362141
}
21372142

@@ -2360,4 +2365,4 @@ mlir::Value CIRGenFunction::emitScalarPrePostIncDec(const UnaryOperator *e,
23602365
bool isPre) {
23612366
return ScalarExprEmitter(*this, builder)
23622367
.emitScalarPrePostIncDec(e, lv, kind, isPre);
2363-
}
2368+
}

clang/test/CIR/CodeGen/complex.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,3 +1233,40 @@ void imag_on_const_scalar() {
12331233
// OGCG: %[[A_ADDR:.*]] = alloca float, align 4
12341234
// OGCG: %[[B_ADDR:.*]] = alloca float, align 4
12351235
// OGCG: store float 0.000000e+00, ptr %[[B_ADDR]], align 4
1236+
1237+
void real_on_scalar_from_real_with_type_promotion() {
1238+
_Float16 _Complex a;
1239+
_Float16 b = __real__(__real__ a);
1240+
}
1241+
1242+
// CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.f16>, !cir.ptr<!cir.complex<!cir.f16>>, ["a"]
1243+
// CIR: %[[B_ADDR:.*]] = cir.alloca !cir.f16, !cir.ptr<!cir.f16>, ["b", init]
1244+
// CIR: %[[TMP_A:.*]] = cir.load{{.*}} %[[A_ADDR]] : !cir.ptr<!cir.complex<!cir.f16>>, !cir.complex<!cir.f16>
1245+
// CIR: %[[A_REAL:.*]] = cir.complex.real %[[TMP_A]] : !cir.complex<!cir.f16> -> !cir.f16
1246+
// CIR: %[[A_IMAG:.*]] = cir.complex.imag %[[TMP_A]] : !cir.complex<!cir.f16> -> !cir.f16
1247+
// CIR: %[[A_REAL_F32:.*]] = cir.cast(floating, %[[A_REAL]] : !cir.f16), !cir.float
1248+
// CIR: %[[A_IMAG_F32:.*]] = cir.cast(floating, %[[A_IMAG]] : !cir.f16), !cir.float
1249+
// CIR: %[[A_COMPLEX_F32:.*]] = cir.complex.create %[[A_REAL_F32]], %[[A_IMAG_F32]] : !cir.float -> !cir.complex<!cir.float>
1250+
// CIR: %[[A_REAL_F32:.*]] = cir.complex.real %[[A_COMPLEX_F32]] : !cir.complex<!cir.float> -> !cir.float
1251+
// CIR: %[[A_REAL_F16:.*]] = cir.cast(floating, %[[A_REAL_F32]] : !cir.float), !cir.f16
1252+
// CIR: cir.store{{.*}} %[[A_REAL_F16]], %[[B_ADDR]] : !cir.f16, !cir.ptr<!cir.f16>
1253+
1254+
// LLVM: %[[A_ADDR:.*]] = alloca { half, half }, i64 1, align 2
1255+
// LLVM: %[[B_ADDR]] = alloca half, i64 1, align 2
1256+
// LLVM: %[[TMP_A:.*]] = load { half, half }, ptr %[[A_ADDR]], align 2
1257+
// LLVM: %[[A_REAL:.*]] = extractvalue { half, half } %[[TMP_A]], 0
1258+
// LLVM: %[[A_IMAG:.*]] = extractvalue { half, half } %[[TMP_A]], 1
1259+
// LLVM: %[[A_REAL_F32:.*]] = fpext half %[[A_REAL]] to float
1260+
// LLVM: %[[A_IMAG_F32:.*]] = fpext half %[[A_IMAG]] to float
1261+
// LLVM: %[[TMP_A_COMPLEX_F32:.*]] = insertvalue { float, float } {{.*}}, float %[[A_REAL_F32]], 0
1262+
// LLVM: %[[A_COMPLEX_F32:.*]] = insertvalue { float, float } %[[TMP_A_COMPLEX_F32]], float %[[A_IMAG_F32]], 1
1263+
// LLVM: %[[A_REAL_F16:.*]] = fptrunc float %[[A_REAL_F32]] to half
1264+
// LLVM: store half %[[A_REAL_F16]], ptr %[[B_ADDR]], align 2
1265+
1266+
// OGCG: %[[A_ADDR:.*]] = alloca { half, half }, align 2
1267+
// OGCG: %[[B_ADDR:.*]] = alloca half, align 2
1268+
// OGCG: %[[A_REAL_PTR:.*]] = getelementptr inbounds nuw { half, half }, ptr %[[A_ADDR]], i32 0, i32 0
1269+
// OGCG: %[[A_REAL:.*]] = load half, ptr %[[A_REAL_PTR]], align 2
1270+
// OGCG: %[[A_REAL_F32:.*]] = fpext half %[[A_REAL]] to float
1271+
// OGCG: %[[A_REAL_F16:.*]] = fptrunc float %[[A_REAL_F32]] to half
1272+
// OGCG: store half %[[A_REAL_F16]], ptr %[[B_ADDR]], align 2

clang/test/CIR/CodeGen/vector-ext.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,4 +1295,30 @@ void foo23() {
12951295
// OGCG: %[[NE_B_ZERO:.*]] = icmp ne <4 x i32> %[[TMP_B]], zeroinitializer
12961296
// OGCG: %[[VEC_OR:.*]] = and <4 x i1> %[[NE_A_ZERO]], %[[NE_B_ZERO]]
12971297
// OGCG: %[[RESULT:.*]] = sext <4 x i1> %[[VEC_OR]] to <4 x i32>
1298-
// OGCG: store <4 x i32> %[[RESULT]], ptr %[[C_ADDR]], align 16
1298+
// OGCG: store <4 x i32> %[[RESULT]], ptr %[[C_ADDR]], align 16
1299+
1300+
void logical_not() {
1301+
vi4 a;
1302+
vi4 b = !a;
1303+
}
1304+
1305+
// CIR: %[[A_ADDR:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["a"]
1306+
// CIR: %[[B_ADDR:.*]] = cir.alloca !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>, ["b", init]
1307+
// CIR: %[[TMP_A:.*]] = cir.load{{.*}}) %[[A_ADDR]] : !cir.ptr<!cir.vector<4 x !s32i>>, !cir.vector<4 x !s32i>
1308+
// CIR: %[[CONST_V0:.*]] = cir.const #cir.zero : !cir.vector<4 x !s32i>
1309+
// CIR: %[[RESULT:.*]] = cir.vec.cmp(eq, %[[TMP_A]], %[[CONST_V0]]) : !cir.vector<4 x !s32i>, !cir.vector<4 x !s32i>
1310+
// CIR: cir.store{{.*}} %[[RESULT]], %[[B_ADDR]] : !cir.vector<4 x !s32i>, !cir.ptr<!cir.vector<4 x !s32i>>
1311+
1312+
// LLVM: %[[A_ADDR:.*]] = alloca <4 x i32>, i64 1, align 16
1313+
// LLVM: %[[B_ADDR:.*]] = alloca <4 x i32>, i64 1, align 16
1314+
// LLVM: %[[TMP_A:.*]] = load <4 x i32>, ptr %[[A_ADDR]], align 16
1315+
// LLVM: %[[RESULT:.*]] = icmp eq <4 x i32> %[[TMP_A]], zeroinitializer
1316+
// LLVM: %[[RESULT_VI4:.*]] = sext <4 x i1> %[[RESULT]] to <4 x i32>
1317+
// LLVM: store <4 x i32> %[[RESULT_VI4]], ptr %[[B_ADDR]], align 16
1318+
1319+
// OGCG: %[[A_ADDR:.*]] = alloca <4 x i32>, align 16
1320+
// OGCG: %[[B_ADDR:.*]] = alloca <4 x i32>, align 16
1321+
// OGCG: %[[TMP_A:.*]] = load <4 x i32>, ptr %[[A_ADDR]], align 16
1322+
// OGCG: %[[RESULT:.*]] = icmp eq <4 x i32> %[[TMP_A]], zeroinitializer
1323+
// OGCG: %[[RESULT_VI4:.*]] = sext <4 x i1> %[[RESULT]] to <4 x i32>
1324+
// OGCG: store <4 x i32> %[[RESULT_VI4]], ptr %[[B_ADDR]], align 16

0 commit comments

Comments
 (0)