File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -278,8 +278,8 @@ class NearestCommonDominator {
278278
279279class StructurizeCFG {
280280 Type *Boolean;
281- ConstantInt *BoolTrue;
282- ConstantInt *BoolFalse;
281+ Value *BoolTrue;
282+ Value *BoolFalse;
283283 Value *BoolPoison;
284284
285285 Function *Func;
@@ -1253,8 +1253,8 @@ void StructurizeCFG::init(Region *R) {
12531253 LLVMContext &Context = R->getEntry ()->getContext ();
12541254
12551255 Boolean = Type::getInt1Ty (Context);
1256- BoolTrue = ConstantInt::getTrue (Context );
1257- BoolFalse = ConstantInt::getFalse (Context );
1256+ BoolTrue = PHINode::Create (Boolean, 0 );
1257+ BoolFalse = PHINode::Create (Boolean, 0 );
12581258 BoolPoison = PoisonValue::get (Boolean);
12591259
12601260 this ->UA = nullptr ;
@@ -1330,6 +1330,9 @@ bool StructurizeCFG::run(Region *R, DominatorTree *DT) {
13301330 FlowSet.clear ();
13311331 TermDL.clear ();
13321332
1333+ BoolTrue->replaceAllUsesWith (ConstantInt::getTrue (Boolean));
1334+ BoolFalse->replaceAllUsesWith (ConstantInt::getFalse (Boolean));
1335+
13331336 return true ;
13341337}
13351338
You can’t perform that action at this time.
0 commit comments