Skip to content

Commit 764e5ec

Browse files
committed
!fixup skip arguments early
1 parent 0782fac commit 764e5ec

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
13191319
ExtraPasses.addPass(EarlyCSEPass());
13201320
ExtraPasses.addPass(CorrelatedValuePropagationPass());
13211321
ExtraPasses.addPass(
1322-
InstCombinePass(InstCombineOptions().setCleanupAssumptions(true)));
1322+
InstCombinePass(InstCombineOptions()));
13231323
LoopPassManager LPM;
13241324
LPM.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
13251325
/*AllowSpeculation=*/true));
@@ -1331,7 +1331,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
13311331
ExtraPasses.addPass(
13321332
SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));
13331333
ExtraPasses.addPass(
1334-
InstCombinePass(InstCombineOptions().setCleanupAssumptions(true)));
1334+
InstCombinePass());
13351335
FPM.addPass(std::move(ExtraPasses));
13361336
}
13371337

@@ -1355,7 +1355,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
13551355
if (IsFullLTO) {
13561356
FPM.addPass(SCCPPass());
13571357
FPM.addPass(
1358-
InstCombinePass(InstCombineOptions().setCleanupAssumptions(true)));
1358+
InstCombinePass(InstCombineOptions()));
13591359
FPM.addPass(BDCEPass());
13601360
}
13611361

@@ -1371,7 +1371,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
13711371

13721372
if (!IsFullLTO) {
13731373
FPM.addPass(
1374-
InstCombinePass(InstCombineOptions().setCleanupAssumptions(true)));
1374+
InstCombinePass(InstCombineOptions()));
13751375
// Unroll small loops to hide loop backedge latency and saturate any
13761376
// parallel execution resources of an out-of-order processor. We also then
13771377
// need to clean up redundancies and loop invariant code.
@@ -1398,7 +1398,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
13981398

13991399
FPM.addPass(InferAlignmentPass());
14001400
FPM.addPass(
1401-
InstCombinePass(InstCombineOptions().setCleanupAssumptions(true)));
1401+
InstCombinePass(InstCombineOptions()));
14021402

14031403
// This is needed for two reasons:
14041404
// 1. It works around problems that instcombine introduces, such as sinking

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3233,10 +3233,15 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
32333233
!isValidAssumeForContext(II, LI, &DT, /*AllowEphemerals=*/true))
32343234
continue;
32353235

3236+
if (!CleanupAssumptions && isa<Argument>(LI->getPointerOperand()))
3237+
continue;
32363238
LI->setMetadata(
32373239
LLVMContext::MD_align,
32383240
MDNode::get(II->getContext(), ValueAsMetadata::getConstant(
32393241
Builder.getInt64(RK.ArgValue))));
3242+
MDNode *MD = MDNode::get(II->getContext(), {});
3243+
LI->setMetadata(LLVMContext::MD_noundef, MD);
3244+
32403245
auto *New = CallBase::removeOperandBundle(II, OBU.getTagID());
32413246
return New;
32423247
}

0 commit comments

Comments
 (0)