@@ -1132,14 +1132,14 @@ struct BitTest {
1132
1132
};
1133
1133
1134
1134
// Returns the first convergence entry/loop/anchor instruction found in |BB|.
1135
- // std::nullopt otherwise.
1136
- std::optional< llvm::IntrinsicInst *> getConvergenceToken(llvm::BasicBlock *BB) {
1135
+ // std::nullptr otherwise.
1136
+ llvm::IntrinsicInst *getConvergenceToken(llvm::BasicBlock *BB) {
1137
1137
for (auto &I : *BB) {
1138
1138
auto *II = dyn_cast<llvm::IntrinsicInst>(&I);
1139
1139
if (II && isConvergenceControlIntrinsic(II->getIntrinsicID()))
1140
1140
return II;
1141
1141
}
1142
- return std::nullopt ;
1142
+ return nullptr ;
1143
1143
}
1144
1144
1145
1145
} // namespace
@@ -1166,19 +1166,15 @@ CodeGenFunction::EmitConvergenceLoop(llvm::BasicBlock *BB,
1166
1166
Builder.restoreIP(IP);
1167
1167
1168
1168
auto I = AddConvergenceControlAttr(CB, ParentToken);
1169
- // Controlled convergence is incompatible with uncontrolled convergence.
1170
- // Removing any old attributes.
1171
- I->setNotConvergent();
1172
-
1173
1169
return cast<llvm::IntrinsicInst>(I);
1174
1170
}
1175
1171
1176
1172
llvm::IntrinsicInst *
1177
1173
CodeGenFunction::getOrEmitConvergenceEntryToken(llvm::Function *F) {
1178
1174
auto *BB = &F->getEntryBlock();
1179
- auto token = getConvergenceToken(BB);
1180
- if (token.has_value() )
1181
- return token.value() ;
1175
+ auto * token = getConvergenceToken(BB);
1176
+ if (token)
1177
+ return token;
1182
1178
1183
1179
// Adding a convergence token requires the function to be marked as
1184
1180
// convergent.
@@ -1198,9 +1194,9 @@ llvm::IntrinsicInst *
1198
1194
CodeGenFunction::getOrEmitConvergenceLoopToken(const LoopInfo *LI) {
1199
1195
assert(LI != nullptr);
1200
1196
1201
- auto token = getConvergenceToken(LI->getHeader());
1202
- if (token.has_value() )
1203
- return * token;
1197
+ auto * token = getConvergenceToken(LI->getHeader());
1198
+ if (token)
1199
+ return token;
1204
1200
1205
1201
llvm::IntrinsicInst *PII =
1206
1202
LI->getParent()
0 commit comments