diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -1189,6 +1189,11 @@ ~Attributor(); /// Run the analyses until a fixpoint is reached or enforced (timeout). + /// This method will run iteration, and manifest the changes to IR. + /// + /// This function runs all Attributor phases, for unrelated sets of + /// attributes, it would be more efficient to run Attributor in multiple + /// stages. \see runStage() and \see finalize() /// /// The attributes registered with this Attributor can be used after as long /// as the Attributor is not destroyed (it owns the attributes now). @@ -1196,6 +1201,27 @@ /// \Returns CHANGED if the IR was changed, otherwise UNCHANGED. ChangeStatus run(); + /// Run a Attributor stage. + /// This method will do fixpoint iteration until fixpoint or the + /// maximum iteration count is reached. + /// + /// If the maximum iteration count is reached, This method will + /// indicate pessimistic fixpoint on attributes that transitively depend + /// on attributes that were scheduled for an update. + /// + /// After calling this function, you can still call `getAAFor` function to + /// seed more Attributes and then you can call this function again to run the + /// iteration one more time. Dividing the deduction process for independent + /// attributes helps with performance. + /// + /// The changes won't be manifested to IR until `finalize` function is called. + void runStage(); + + /// Manifest the changes to IR and clean up deleted functions. + /// + /// \Returns CHANGED if the IR was changed, otherwise UNCHANGED. + ChangeStatus finalize(); + /// Lookup an abstract attribute of type \p AAType at position \p IRP. While /// no abstract attribute is found equivalent positions are checked, see /// SubsumingPositionIterator. Thus, the returned abstract attribute @@ -1417,6 +1443,14 @@ return Functions.empty() || Functions.count(&Fn); } + /// Seed initial Attributes that should be run in the first stage. + /// Seeding Attributes such as `AAIsDead` before any other attribute, + /// helps with performance as it reduces wasted updates. + /// + /// \param F The function that is checked for attribute opportunities. + /// + void identifyFirstStageAttributes(Function &F); + /// Determine opportunities to derive 'default' attributes in \p F and create /// abstract attribute objects for them. /// @@ -1897,12 +1931,6 @@ BumpPtrAllocator &Allocator; private: - /// This method will do fixpoint iteration until fixpoint or the - /// maximum iteration count is reached. - /// - /// If the maximum iteration count is reached, This method will - /// indicate pessimistic fixpoint on attributes that transitively depend - /// on attributes that were scheduled for an update. void runTillFixpoint(); /// Gets called after scheduling, manifests attributes to the LLVM IR. @@ -2008,9 +2036,6 @@ /// Maximum number of fixedpoint iterations. Optional MaxFixpointIterations; - /// A set to remember the functions we already assume to be live and visited. - DenseSet VisitedFunctions; - /// Uses we replace with a new value after manifest is done. We will remove /// then trivially dead instructions as well. DenseMap ToBeChangedUses; diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -1313,15 +1313,16 @@ return true; } -void Attributor::runTillFixpoint() { - TimeTraceScope TimeScope("Attributor::runTillFixpoint"); +void Attributor::runStage() { + Phase = AttributorPhase::UPDATE; + + TimeTraceScope TimeScope("Attributor::runIterationStage"); LLVM_DEBUG(dbgs() << "[Attributor] Identified and initialized " << DG.SyntheticRoot.Deps.size() << " abstract attributes.\n"); // Now that all abstract attributes are collected and initialized we start // the abstract analysis. - unsigned IterationCounter = 1; unsigned MaxFixedPointIterations; if (MaxFixpointIterations) @@ -1450,9 +1451,13 @@ errs() << "\n[Attributor] Fixpoint iteration done after: " << IterationCounter << "/" << MaxFixedPointIterations << " iterations\n"; - llvm_unreachable("The fixpoint was not reached with exactly the number of " - "specified iterations!"); + // llvm_unreachable("The fixpoint was not reached with exactly the number of + // " + // "specified iterations!"); } + + // We can still seed more attributes after running a fixpoint iteration. + Phase = AttributorPhase::SEEDING; } ChangeStatus Attributor::manifestAttributes() { @@ -1817,8 +1822,7 @@ if (PrintCallGraph) ACallGraph.populateAll(); - Phase = AttributorPhase::UPDATE; - runTillFixpoint(); + runStage(); // dump graphs on demand if (DumpDepGraph) @@ -1830,15 +1834,23 @@ if (PrintDependencies) DG.print(); + if (PrintCallGraph) + ACallGraph.print(); + + return finalize(); +} + +ChangeStatus Attributor::finalize() { + // More attributes can be seeded after the runStage() function is called. + assert(Phase == AttributorPhase::SEEDING && + "Expected attributor to be in the seeeding stage!"); + Phase = AttributorPhase::MANIFEST; ChangeStatus ManifestChange = manifestAttributes(); Phase = AttributorPhase::CLEANUP; ChangeStatus CleanupChange = cleanupIR(); - if (PrintCallGraph) - ACallGraph.print(); - return ManifestChange | CleanupChange; } @@ -2426,12 +2438,12 @@ } } -void Attributor::identifyDefaultAbstractAttributes(Function &F) { - if (!VisitedFunctions.insert(&F).second) - return; +void Attributor::identifyFirstStageAttributes(Function &F) { if (F.isDeclaration()) return; + IRPosition FPos = IRPosition::function(F); + // In non-module runs we need to look at the call sites of a function to // determine if it is part of a must-tail call edge. This will influence what // attributes we can derive. @@ -2443,13 +2455,69 @@ FI.CalledViaMustTail = true; } - IRPosition FPos = IRPosition::function(F); - // Check for dead BasicBlocks in every function. // We need dead instruction detection because we do not want to deal with // broken IR in which SSA rules do not apply. getOrCreateAAFor(FPos); + // Return attributes are only appropriate if the return type is non void. + Type *ReturnType = F.getReturnType(); + if (!ReturnType->isVoidTy()) { + IRPosition RetPos = IRPosition::returned(F); + + // Every returned value might be dead. + getOrCreateAAFor(RetPos); + } + + for (Argument &Arg : F.args()) { + IRPosition ArgPos = IRPosition::argument(Arg); + + // Every argument might be dead. + getOrCreateAAFor(ArgPos); + } + + auto CallSitePred = [&](Instruction &I) -> bool { + auto &CB = cast(I); + IRPosition CBRetPos = IRPosition::callsite_returned(CB); + + // Call sites might be dead if they do not have side effects and no live + // users. The return value might be dead if there are no live users. + getOrCreateAAFor(CBRetPos); + + Function *Callee = CB.getCalledFunction(); + // TODO: Even if the callee is not known now we might be able to simplify + // the call/callee. + if (!Callee) + return true; + + for (int I = 0, E = CB.getNumArgOperands(); I < E; ++I) { + IRPosition CBArgPos = IRPosition::callsite_argument(CB, I); + + // Every call site argument might be dead. + getOrCreateAAFor(CBArgPos); + } + + return true; + }; + + auto &OpcodeInstMap = InfoCache.getOpcodeInstMapForFunction(F); + bool Success; + bool UsedAssumedInformation = false; + Success = checkForAllInstructionsImpl( + nullptr, OpcodeInstMap, CallSitePred, nullptr, nullptr, + {(unsigned)Instruction::Invoke, (unsigned)Instruction::CallBr, + (unsigned)Instruction::Call}, + UsedAssumedInformation); + (void)Success; + assert(Success && "Expected the check call to be successful!"); +} + +void Attributor::identifyDefaultAbstractAttributes(Function &F) { + if (F.isDeclaration()) + return; + + IRPosition FPos = IRPosition::function(F); + // Every function might be "will-return". getOrCreateAAFor(FPos); @@ -2490,9 +2558,6 @@ IRPosition RetPos = IRPosition::returned(F); - // Every returned value might be dead. - getOrCreateAAFor(RetPos); - // Every function might be simplified. getOrCreateAAFor(RetPos); @@ -2525,9 +2590,6 @@ bool UsedAssumedInformation = false; getAssumedSimplified(ArgPos, /* AA */ nullptr, UsedAssumedInformation); - // Every argument might be dead. - getOrCreateAAFor(ArgPos); - // Every argument might be marked noundef. getOrCreateAAFor(ArgPos); @@ -2561,12 +2623,6 @@ auto CallSitePred = [&](Instruction &I) -> bool { auto &CB = cast(I); - IRPosition CBRetPos = IRPosition::callsite_returned(CB); - - // Call sites might be dead if they do not have side effects and no live - // users. The return value might be dead if there are no live users. - getOrCreateAAFor(CBRetPos); - Function *Callee = CB.getCalledFunction(); // TODO: Even if the callee is not known now we might be able to simplify // the call/callee. @@ -2589,9 +2645,6 @@ IRPosition CBArgPos = IRPosition::callsite_argument(CB, I); - // Every call site argument might be dead. - getOrCreateAAFor(CBArgPos); - // Call site argument might be simplified. We have to go through the // Attributor interface though as outside AAs can register custom // simplification callbacks. @@ -2827,12 +2880,14 @@ } } - for (Function *F : Functions) { - if (F->hasExactDefinition()) - NumFnWithExactDefinition++; - else - NumFnWithoutExactDefinition++; + // We are running the Attributor in two stages. + // First we identify first stage attributes (like AAIsDead). + // We run a fixpoint iteration for those attributes + // before running a iteration on the rest, this helps with the performance. + // TODO: Consider running each function as a separate stage. + + auto ShouldSkipFunction = [&](Function *F) { // We look at internal functions only on-demand but if any use is not a // direct call or outside the current set of analyzed functions, we have // to do it eagerly. @@ -2842,15 +2897,41 @@ return CB && CB->isCallee(&U) && Functions.count(const_cast(CB->getCaller())); })) - continue; + return true; } - // Populate the Attributor with abstract attribute opportunities in the - // function and the information cache with IR information. + return false; + }; + + for (Function *F : Functions) { + if (F->hasExactDefinition()) + NumFnWithExactDefinition++; + else + NumFnWithoutExactDefinition++; + + if (ShouldSkipFunction(F)) + continue; + + // Identify AbstactAttribute oppurtunities that shuold be run on the first + // stage. + A.identifyFirstStageAttributes(*F); + } + + // Run the first stage. + A.runStage(); + + for (Function *F : Functions) { + if (ShouldSkipFunction(F)) + continue; + A.identifyDefaultAbstractAttributes(*F); } - ChangeStatus Changed = A.run(); + // Run the second stage. + A.runStage(); + + // Finalize the Attributor. + ChangeStatus Changed = A.finalize(); LLVM_DEBUG(dbgs() << "[Attributor] Done with " << Functions.size() << " functions, result: " << Changed << ".\n"); diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll @@ -170,7 +170,7 @@ ; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: [[A_PRIV:%.*]] = alloca i32, align 4 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i64 undef) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 2, i64 undef) #[[ATTR1:[0-9]+]], !range [[RNG0:![0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i32 [[C]] ; %B = alloca i64 @@ -180,7 +180,7 @@ } define i32 @callercaller() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 @@ -188,7 +188,7 @@ ; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret i32 [[X]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 @@ -219,7 +219,7 @@ ;. ; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll @@ -93,7 +93,7 @@ ; ; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { +; IS__TUNIT_OPM-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { ; IS__TUNIT_OPM-NEXT: entry: ; IS__TUNIT_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; IS__TUNIT_OPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 @@ -104,7 +104,7 @@ ; ; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test -; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0]] { +; IS__TUNIT_NPM-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0]] { ; IS__TUNIT_NPM-NEXT: entry: ; IS__TUNIT_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll @@ -85,7 +85,7 @@ ; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR0]] { ; IS__CGSCC_NPM-NEXT: [[B_PRIV:%.*]] = alloca i32, align 4 ; IS__CGSCC_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_PRIV]], align 4 -; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i32 undef) #[[ATTR1:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32 undef, i32 2) #[[ATTR1:[0-9]+]] ; IS__CGSCC_NPM-NEXT: ret i32 undef ; %A = alloca i32 @@ -95,7 +95,7 @@ } define i32 @callercaller() { -; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__TUNIT_OPM-NEXT: [[B:%.*]] = alloca i32, align 4 @@ -103,7 +103,7 @@ ; IS__TUNIT_OPM-NEXT: [[X:%.*]] = call i32 @caller(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR4:[0-9]+]] ; IS__TUNIT_OPM-NEXT: ret i32 [[X]] ; -; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone +; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@callercaller ; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__TUNIT_NPM-NEXT: [[B:%.*]] = alloca i32, align 4 @@ -134,7 +134,7 @@ ;. ; IS__TUNIT____: attributes #[[ATTR0:[0-9]+]] = { argmemonly nofree nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR1:[0-9]+]] = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes #[[ATTR2:[0-9]+]] = { nofree nosync nounwind readnone willreturn } ; IS__TUNIT____: attributes #[[ATTR3:[0-9]+]] = { nofree nosync nounwind readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR4:[0-9]+]] = { nofree nosync nounwind willreturn } ;. diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll @@ -49,7 +49,7 @@ ; ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[X:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[S:%.*]] = alloca [[STRUCT_SS:%.*]], align 8 ; IS__TUNIT____-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll @@ -150,15 +150,15 @@ ; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 0 ; IS__TUNIT_NPM-NEXT: store i32 1, i32* [[TMP1]], align 8 ; IS__TUNIT_NPM-NEXT: [[TMP4:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST]], align 8 -; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_1]], align 8 -; IS__TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]] ; IS__TUNIT_NPM-NEXT: [[S_CAST1:%.*]] = bitcast %struct.ss* [[S]] to i32* -; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST1]], align 32 +; IS__TUNIT_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[S_CAST1]], align 8 ; IS__TUNIT_NPM-NEXT: [[S_0_12:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 -; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_12]], align 32 +; IS__TUNIT_NPM-NEXT: [[TMP1:%.*]] = load i64, i64* [[S_0_12]], align 8 +; IS__TUNIT_NPM-NEXT: [[C0:%.*]] = call i32 @f(i32 [[TMP0]], i64 [[TMP1]]) #[[ATTR0]] +; IS__TUNIT_NPM-NEXT: [[S_CAST:%.*]] = bitcast %struct.ss* [[S]] to i32* +; IS__TUNIT_NPM-NEXT: [[TMP2:%.*]] = load i32, i32* [[S_CAST]], align 32 +; IS__TUNIT_NPM-NEXT: [[S_0_1:%.*]] = getelementptr [[STRUCT_SS]], %struct.ss* [[S]], i32 0, i32 1 +; IS__TUNIT_NPM-NEXT: [[TMP3:%.*]] = load i64, i64* [[S_0_1]], align 32 ; IS__TUNIT_NPM-NEXT: [[C1:%.*]] = call i32 @g(i32 [[TMP2]], i64 [[TMP3]]) #[[ATTR0]] ; IS__TUNIT_NPM-NEXT: [[A:%.*]] = add i32 [[C0]], [[C1]] ; IS__TUNIT_NPM-NEXT: ret i32 [[A]] diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll @@ -15,15 +15,25 @@ } define internal i32 @test(i32* %X, i32* %Y) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { -; NOT_CGSCC_NPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] -; NOT_CGSCC_NPM: live: -; NOT_CGSCC_NPM-NEXT: store i32 0, i32* [[X]], align 4 -; NOT_CGSCC_NPM-NEXT: ret i32 undef -; NOT_CGSCC_NPM: dead: -; NOT_CGSCC_NPM-NEXT: unreachable +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@test +; IS__TUNIT____-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]], i32* noalias nocapture nofree noundef readnone align 4 [[Y:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__TUNIT____-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; IS__TUNIT____: live: +; IS__TUNIT____-NEXT: store i32 0, i32* [[X]], align 4 +; IS__TUNIT____-NEXT: ret i32 undef +; IS__TUNIT____: dead: +; IS__TUNIT____-NEXT: unreachable +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test +; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef writeonly align 4 [[X:%.*]]) #[[ATTR0:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: br i1 true, label [[LIVE:%.*]], label [[DEAD:%.*]] +; IS__CGSCC_OPM: live: +; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[X]], align 4 +; IS__CGSCC_OPM-NEXT: ret i32 undef +; IS__CGSCC_OPM: dead: +; IS__CGSCC_OPM-NEXT: unreachable ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test @@ -46,12 +56,19 @@ } define internal i32 @caller(i32* %B) { -; NOT_CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly -; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@caller -; NOT_CGSCC_NPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { -; NOT_CGSCC_NPM-NEXT: [[A:%.*]] = alloca i32, align 4 -; NOT_CGSCC_NPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] -; NOT_CGSCC_NPM-NEXT: ret i32 undef +; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__TUNIT____-LABEL: define {{[^@]+}}@caller +; IS__TUNIT____-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-NEXT: [[A:%.*]] = alloca i32, align 4 +; IS__TUNIT____-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]], i32* noalias nocapture nofree noundef nonnull readnone align 4 dereferenceable(4) [[A]]) #[[ATTR2:[0-9]+]] +; IS__TUNIT____-NEXT: ret i32 undef +; +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller +; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B:%.*]]) #[[ATTR0]] { +; IS__CGSCC_OPM-NEXT: [[A:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: [[C:%.*]] = call i32 @test(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[B]]) #[[ATTR2:[0-9]+]] +; IS__CGSCC_OPM-NEXT: ret i32 undef ; ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller diff --git a/llvm/test/Transforms/Attributor/allow_list.ll b/llvm/test/Transforms/Attributor/allow_list.ll --- a/llvm/test/Transforms/Attributor/allow_list.ll +++ b/llvm/test/Transforms/Attributor/allow_list.ll @@ -27,11 +27,6 @@ ; CHECK_DISABLED_FUNCTION-NEXT: [[TMP1:%.*]] = icmp sgt i32 [[A]], 100 ; CHECK_DISABLED_FUNCTION-NEXT: [[TMP2:%.*]] = zext i1 [[TMP1]] to i32 ; CHECK_DISABLED_FUNCTION-NEXT: ret i32 [[TMP2]] -; -; CHECK_ENABLED_FUNCTION: Function Attrs: noinline nounwind readnone uwtable -; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_test -; CHECK_ENABLED_FUNCTION-SAME: () #[[ATTR0:[0-9]+]] { -; CHECK_ENABLED_FUNCTION-NEXT: ret i32 1 ; %1 = icmp sgt i32 %a, 100 %2 = zext i1 %1 to i32 @@ -59,7 +54,7 @@ ; ; CHECK_ENABLED_FUNCTION: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_use1 -; CHECK_ENABLED_FUNCTION-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK_ENABLED_FUNCTION-SAME: () #[[ATTR0:[0-9]+]] { ; CHECK_ENABLED_FUNCTION-NEXT: ret i32 1 ; %1 = call i32 @range_test(i32 123) @@ -87,9 +82,8 @@ ; ; CHECK_ENABLED_FUNCTION: Function Attrs: noinline nounwind uwtable ; CHECK_ENABLED_FUNCTION-LABEL: define {{[^@]+}}@range_use2 -; CHECK_ENABLED_FUNCTION-SAME: () #[[ATTR2:[0-9]+]] { -; CHECK_ENABLED_FUNCTION-NEXT: [[TMP1:%.*]] = call i32 @range_test() -; CHECK_ENABLED_FUNCTION-NEXT: ret i32 [[TMP1]] +; CHECK_ENABLED_FUNCTION-SAME: () #[[ATTR1:[0-9]+]] { +; CHECK_ENABLED_FUNCTION-NEXT: ret i32 1 ; %1 = call i32 @range_test(i32 123) ret i32 %1 @@ -103,7 +97,6 @@ ;. ; CHECK_DISABLED_FUNCTION: attributes #[[ATTR0]] = { noinline nounwind uwtable } ;. -; CHECK_ENABLED_FUNCTION: attributes #[[ATTR0]] = { noinline nounwind readnone uwtable } -; CHECK_ENABLED_FUNCTION: attributes #[[ATTR1]] = { nofree noinline nosync nounwind readnone uwtable willreturn } -; CHECK_ENABLED_FUNCTION: attributes #[[ATTR2]] = { noinline nounwind uwtable } +; CHECK_ENABLED_FUNCTION: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CHECK_ENABLED_FUNCTION: attributes #[[ATTR1]] = { noinline nounwind uwtable } ;. diff --git a/llvm/test/Transforms/Attributor/internal-noalias.ll b/llvm/test/Transforms/Attributor/internal-noalias.ll --- a/llvm/test/Transforms/Attributor/internal-noalias.ll +++ b/llvm/test/Transforms/Attributor/internal-noalias.ll @@ -112,7 +112,7 @@ define dso_local i32 @visible_local(i32* %A) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@visible_local -; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[A:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 4 [[A:%.*]]) #[[ATTR1:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[B:%.*]] = alloca i32, align 4 ; IS__TUNIT____-NEXT: store i32 5, i32* [[B]], align 4 diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll --- a/llvm/test/Transforms/Attributor/memory_locations.ll +++ b/llvm/test/Transforms/Attributor/memory_locations.ll @@ -664,7 +664,7 @@ ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone ; IS__TUNIT____-LABEL: define {{[^@]+}}@readnone_caller2 ; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR9]] { -; IS__TUNIT____-NEXT: [[R:%.*]] = call noundef i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR10]], !range [[RNG0]] +; IS__TUNIT____-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(i8* undef, i1 [[C]]) #[[ATTR10]], !range [[RNG0]] ; IS__TUNIT____-NEXT: ret i8 [[R]] ; ; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone diff --git a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll --- a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll +++ b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll @@ -40,8 +40,8 @@ ; IS__TUNIT____-SAME: (i32* nofree [[N0:%.*]], i32* nofree [[R0:%.*]], i32* nofree returned [[W0:%.*]]) #[[ATTR0:[0-9]+]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call i32* @internal_ret0_nw(i32* nofree [[N0]], i32* nofree [[W0]]) #[[ATTR2:[0-9]+]] -; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree [[R0]], i32* nofree [[W0]]) #[[ATTR2]] -; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL1:%.*]] = call i32* @internal_ret1_rrw(i32* nofree align 4 [[R0]], i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] +; IS__TUNIT____-NEXT: [[CALL2:%.*]] = call i32* @external_sink_ret2_nrw(i32* nofree [[N0]], i32* nocapture nofree readonly align 4 [[R0]], i32* nofree writeonly "no-capture-maybe-returned" [[W0]]) #[[ATTR2]] ; IS__TUNIT____-NEXT: [[CALL3:%.*]] = call i32* @internal_ret1_rw(i32* nofree align 4 [[R0]], i32* nofree [[W0]]) #[[ATTR2]] ; IS__TUNIT____-NEXT: ret i32* [[W0]] ; @@ -143,7 +143,7 @@ define internal i32* @internal_ret1_rrw(i32* %r0, i32* %r1, i32* %w0) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind ; IS__TUNIT____-LABEL: define {{[^@]+}}@internal_ret1_rrw -; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { +; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 4 dereferenceable(4) [[R0:%.*]], i32* nofree align 4 [[R1:%.*]], i32* nofree [[W0:%.*]]) #[[ATTR0]] { ; IS__TUNIT____-NEXT: entry: ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[R0]], align 4 ; IS__TUNIT____-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0 diff --git a/llvm/test/Transforms/Attributor/readattrs.ll b/llvm/test/Transforms/Attributor/readattrs.ll --- a/llvm/test/Transforms/Attributor/readattrs.ll +++ b/llvm/test/Transforms/Attributor/readattrs.ll @@ -384,6 +384,7 @@ ; IS__TUNIT____-SAME: (i8* nocapture readonly [[READ_ONLY:%.*]]) { ; IS__TUNIT____-NEXT: call void @byval_not_readonly_1(i8* nocapture readonly byval(i8) [[READ_ONLY]]) #[[ATTR2]] ; IS__TUNIT____-NEXT: call void @byval_not_readnone_1(i8* noalias nocapture readnone byval(i8) [[READ_ONLY]]) +; IS__TUNIT____-NEXT: call void @byval_no_fnarg(i8* nocapture nofree readonly byval(i8) [[READ_ONLY]]) #[[ATTR13:[0-9]+]] ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____: Function Attrs: readonly @@ -486,6 +487,7 @@ ; IS__TUNIT____: attributes #[[ATTR10]] = { willreturn writeonly } ; IS__TUNIT____: attributes #[[ATTR11]] = { readonly willreturn } ; IS__TUNIT____: attributes #[[ATTR12]] = { nounwind } +; IS__TUNIT____: attributes #[[ATTR13]] = { nounwind writeonly } ;. ; IS__CGSCC____: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind willreturn writeonly } ; IS__CGSCC____: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll --- a/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll +++ b/llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll @@ -169,41 +169,77 @@ ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR6]] ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 -; IS__CGSCC____-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 -; IS__CGSCC____-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR8:[0-9]+]] -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC____-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC____-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR9:[0-9]+]] -; IS__CGSCC____-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR9]] -; IS__CGSCC____-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR9]] -; IS__CGSCC____-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC____-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] -; IS__CGSCC____-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__CGSCC____-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC____-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] -; IS__CGSCC____-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__CGSCC____-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC____-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] -; IS__CGSCC____-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC____-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] -; IS__CGSCC____-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 -; IS__CGSCC____-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC____-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] -; IS__CGSCC____-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 -; IS__CGSCC____-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC____-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] -; IS__CGSCC____-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 +; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR11:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12:[0-9]+]] +; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; IS__CGSCC_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; IS__CGSCC_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 +; IS__CGSCC_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; IS__CGSCC_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 +; IS__CGSCC_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; IS__CGSCC_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] +; IS__CGSCC_OPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_1 +; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR1:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[S:%.*]] = alloca [[STRUCT_S]], align 4 +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast %struct.S* [[S]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I]]) #[[ATTR8:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR9:[0-9]+]] +; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F12]], align 4, !tbaa [[TBAA7:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; IS__CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; IS__CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[I19]], align 4, !tbaa [[TBAA12:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 2, 1 +; IS__CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; IS__CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 3, 1 +; IS__CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; IS__CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14:![0-9]+]] +; IS__CGSCC_NPM-NEXT: [[I12:%.*]] = bitcast %struct.S* [[S]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 24, i8* nocapture nofree noundef nonnull align 4 dereferenceable(24) [[I12]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: ret void ; entry: %s = alloca %struct.S, align 4 @@ -436,7 +472,9 @@ ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR6]] ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 +; IS__CGSCC_OPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__CGSCC_OPM-NEXT: entry: ; IS__CGSCC_OPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; IS__CGSCC_OPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 @@ -451,11 +489,10 @@ ; IS__CGSCC_OPM: for.body: ; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] ; IS__CGSCC_OPM: for.inc: ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]] ; IS__CGSCC_OPM: for.end: ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]] ; IS__CGSCC_OPM: for.cond2: @@ -469,11 +506,10 @@ ; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 ; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] -; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]] ; IS__CGSCC_OPM: for.inc9: ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]] ; IS__CGSCC_OPM: for.end11: ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]] ; IS__CGSCC_OPM: for.cond13: @@ -487,17 +523,15 @@ ; IS__CGSCC_OPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 ; IS__CGSCC_OPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] -; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]] ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC22]] ; IS__CGSCC_OPM: for.inc22: ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]] ; IS__CGSCC_OPM: for.end24: ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 -; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 ; IS__CGSCC_OPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR10:[0-9]+]] +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR13:[0-9]+]] ; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28:%.*]] ; IS__CGSCC_OPM: for.cond28: ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] @@ -506,20 +540,20 @@ ; IS__CGSCC_OPM: for.cond.cleanup30: ; IS__CGSCC_OPM-NEXT: br label [[FOR_END38:%.*]] ; IS__CGSCC_OPM: for.body31: -; IS__CGSCC_OPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]] ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_OPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]] +; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]] ; IS__CGSCC_OPM-NEXT: br label [[FOR_INC36]] ; IS__CGSCC_OPM: for.inc36: ; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] ; IS__CGSCC_OPM: for.end38: ; IS__CGSCC_OPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]]) +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) ; IS__CGSCC_OPM-NEXT: ret void ; -; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2() { +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_simplifiable_2 +; IS__CGSCC_NPM-SAME: () #[[ATTR2:[0-9]+]] { ; IS__CGSCC_NPM-NEXT: entry: ; IS__CGSCC_NPM-NEXT: [[BYTES:%.*]] = alloca [1024 x i8], align 16 ; IS__CGSCC_NPM-NEXT: [[I:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 @@ -534,11 +568,10 @@ ; IS__CGSCC_NPM: for.body: ; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[I15]] -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] ; IS__CGSCC_NPM: for.inc: ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]] ; IS__CGSCC_NPM: for.end: ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] ; IS__CGSCC_NPM: for.cond2: @@ -552,11 +585,10 @@ ; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 ; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = or i64 [[I17]], 1 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I16]], i64 [[I18]] -; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]] ; IS__CGSCC_NPM: for.inc9: ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP19:![0-9]+]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP17:![0-9]+]] ; IS__CGSCC_NPM: for.end11: ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] ; IS__CGSCC_NPM: for.cond13: @@ -570,17 +602,15 @@ ; IS__CGSCC_NPM-NEXT: [[I20:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 ; IS__CGSCC_NPM-NEXT: [[I21:%.*]] = add nuw nsw i64 [[I20]], 2 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i64, i64* [[I19]], i64 [[I21]] -; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX21]], align 16, !tbaa [[TBAA20:![0-9]+]] ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC22]] ; IS__CGSCC_NPM: for.inc22: ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP22:![0-9]+]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP18:![0-9]+]] ; IS__CGSCC_NPM: for.end24: ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 1023 -; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX25]], align 1, !tbaa [[TBAA15]] ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX26:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 500 ; IS__CGSCC_NPM-NEXT: [[I22:%.*]] = bitcast i8* [[ARRAYIDX26]] to i32* -; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I22]], i32 noundef 0) #[[ATTR10:[0-9]+]] +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) [[I22]], i32 noundef 0) #[[ATTR9]] ; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28:%.*]] ; IS__CGSCC_NPM: for.cond28: ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC36:%.*]] ], [ 0, [[FOR_END24]] ] @@ -589,17 +619,15 @@ ; IS__CGSCC_NPM: for.cond.cleanup30: ; IS__CGSCC_NPM-NEXT: br label [[FOR_END38:%.*]] ; IS__CGSCC_NPM: for.body31: -; IS__CGSCC_NPM-NEXT: [[ARRAYIDX33:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: [[I23:%.*]] = load i8, i8* [[ARRAYIDX33]], align 1, !tbaa [[TBAA15]] ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX35:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC_NPM-NEXT: store i8 [[I23]], i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA15]] +; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX35]], align 1, !tbaa [[TBAA19:![0-9]+]] ; IS__CGSCC_NPM-NEXT: br label [[FOR_INC36]] ; IS__CGSCC_NPM: for.inc36: ; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP23:![0-9]+]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND28]], !llvm.loop [[LOOP20:![0-9]+]] ; IS__CGSCC_NPM: for.end38: ; IS__CGSCC_NPM-NEXT: [[I24:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[BYTES]], i64 0, i64 0 -; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nofree noundef nonnull [[I24]]) +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 1024, i8* nocapture nofree noundef nonnull align 16 dereferenceable(1024) [[I24]]) #[[ATTR8]] ; IS__CGSCC_NPM-NEXT: ret void ; entry: @@ -726,7 +754,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_3 -; IS__CGSCC____-SAME: () #[[ATTR2:[0-9]+]] { +; IS__CGSCC____-SAME: () #[[ATTR3:[0-9]+]] { ; IS__CGSCC____-NEXT: [[A:%.*]] = alloca i32, align 4 ; IS__CGSCC____-NEXT: store i32 1, i32* [[A]], align 4 ; IS__CGSCC____-NEXT: br label [[SPLIT:%.*]] @@ -756,7 +784,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@local_alloca_simplifiable_4 -; IS__CGSCC____-SAME: () #[[ATTR2]] { +; IS__CGSCC____-SAME: () #[[ATTR3]] { ; IS__CGSCC____-NEXT: ret i32 undef ; %A = alloca i32, align 4 @@ -807,23 +835,41 @@ ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR6]] ; IS__TUNIT_NPM-NEXT: ret i32 5 ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 -; IS__CGSCC____-SAME: (i32 [[CND:%.*]]) #[[ATTR3:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: ret i32 5 +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 +; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; IS__CGSCC_OPM: cond.true: +; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_OPM: cond.false: +; IS__CGSCC_OPM-NEXT: br label [[COND_END]] +; IS__CGSCC_OPM: cond.end: +; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: ret i32 5 +; +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_1 +; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; IS__CGSCC_NPM: cond.true: +; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_NPM: cond.false: +; IS__CGSCC_NPM-NEXT: br label [[COND_END]] +; IS__CGSCC_NPM: cond.end: +; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I2]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: ret i32 5 ; entry: %L = alloca i32, align 4 @@ -893,23 +939,41 @@ ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR6]] ; IS__TUNIT_NPM-NEXT: ret i32 5 ; -; IS__CGSCC____: Function Attrs: nofree nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 -; IS__CGSCC____-SAME: (i32 [[CND:%.*]]) #[[ATTR3]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[L:%.*]] = alloca i32, align 4 -; IS__CGSCC____-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 -; IS__CGSCC____-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] -; IS__CGSCC____: cond.true: -; IS__CGSCC____-NEXT: br label [[COND_END:%.*]] -; IS__CGSCC____: cond.false: -; IS__CGSCC____-NEXT: br label [[COND_END]] -; IS__CGSCC____: cond.end: -; IS__CGSCC____-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* -; IS__CGSCC____-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]] -; IS__CGSCC____-NEXT: ret i32 5 +; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 +; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR4]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; IS__CGSCC_OPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; IS__CGSCC_OPM: cond.true: +; IS__CGSCC_OPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_OPM: cond.false: +; IS__CGSCC_OPM-NEXT: br label [[COND_END]] +; IS__CGSCC_OPM: cond.end: +; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: ret i32 5 +; +; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@multi_obj_simplifiable_2 +; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR2]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[L:%.*]] = alloca i32, align 4 +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[CND]], 0 +; IS__CGSCC_NPM-NEXT: br i1 [[TOBOOL_NOT]], label [[COND_FALSE:%.*]], label [[COND_TRUE:%.*]] +; IS__CGSCC_NPM: cond.true: +; IS__CGSCC_NPM-NEXT: br label [[COND_END:%.*]] +; IS__CGSCC_NPM: cond.false: +; IS__CGSCC_NPM-NEXT: br label [[COND_END]] +; IS__CGSCC_NPM: cond.end: +; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[L]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: ret i32 5 ; entry: %L = alloca i32, align 4 @@ -1002,30 +1066,55 @@ ; IS__TUNIT_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@static_global_simplifiable_1 -; IS__CGSCC____-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR9]] -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR9]] -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR9]] -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC____-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC____-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 -; IS__CGSCC____-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC____-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] -; IS__CGSCC____-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 -; IS__CGSCC____-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC____-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC____-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC____-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] -; IS__CGSCC____-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 -; IS__CGSCC____-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC____-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC____-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 -; IS__CGSCC____-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC____-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 +; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR5:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] +; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] +; IS__CGSCC_OPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 +; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; IS__CGSCC_OPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] +; IS__CGSCC_OPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 +; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; IS__CGSCC_OPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_1 +; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]]) #[[ATTR4:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(24) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i32 0, i32 0), i32 noundef 1) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 1), i32 noundef 2) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(16) getelementptr inbounds ([[STRUCT_S]], %struct.S* @Gs1, i64 0, i32 2), i32 noundef 3) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float 0x40019999A0000000, 2.000000e+00 +; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F2]], align 4, !tbaa [[TBAA10]] +; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float 0x400A666660000000, 0x3FF19999A0000000 +; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F3]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[I1]], align 4, !tbaa [[TBAA12]] +; IS__CGSCC_NPM-NEXT: [[MUL1:%.*]] = shl nsw i32 2, 1 +; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; IS__CGSCC_NPM-NEXT: store i32 [[MUL1]], i32* [[I2]], align 4, !tbaa [[TBAA13]] +; IS__CGSCC_NPM-NEXT: [[ADD2:%.*]] = add nsw i32 3, 1 +; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; IS__CGSCC_NPM-NEXT: store i32 [[ADD2]], i32* [[I3]], align 4, !tbaa [[TBAA14]] +; IS__CGSCC_NPM-NEXT: ret void ; entry: store float 0x3FF19999A0000000, float* getelementptr inbounds (%struct.S, %struct.S* @Gs1, i64 0, i32 3), align 4, !tbaa !7 @@ -1215,78 +1304,143 @@ ; IS__TUNIT_NPM: for.end35: ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@static_global_simplifiable_2() { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC____: for.cond: -; IS__CGSCC____-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC____: for.cond.cleanup: -; IS__CGSCC____-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC____: for.body: -; IS__CGSCC____-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] -; IS__CGSCC____-NEXT: store i8 0, i8* [[ARRAYIDX]], align 2, !tbaa [[TBAA15:![0-9]+]] -; IS__CGSCC____-NEXT: br label [[FOR_INC]] -; IS__CGSCC____: for.inc: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]] -; IS__CGSCC____: for.end: -; IS__CGSCC____-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC____: for.cond2: -; IS__CGSCC____-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC____-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC____: for.cond.cleanup4: -; IS__CGSCC____-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC____: for.body5: -; IS__CGSCC____-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC____-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] -; IS__CGSCC____-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18:![0-9]+]] -; IS__CGSCC____-NEXT: br label [[FOR_INC9]] -; IS__CGSCC____: for.inc9: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP25:![0-9]+]] -; IS__CGSCC____: for.end11: -; IS__CGSCC____-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC____: for.cond13: -; IS__CGSCC____-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC____-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC____: for.cond.cleanup15: -; IS__CGSCC____-NEXT: br label [[FOR_END23:%.*]] -; IS__CGSCC____: for.body16: -; IS__CGSCC____-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC____-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 -; IS__CGSCC____-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] -; IS__CGSCC____-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 16, !tbaa [[TBAA20:![0-9]+]] -; IS__CGSCC____-NEXT: br label [[FOR_INC21]] -; IS__CGSCC____: for.inc21: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP26:![0-9]+]] -; IS__CGSCC____: for.end23: -; IS__CGSCC____-NEXT: store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 1023), align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR10:[0-9]+]] -; IS__CGSCC____-NEXT: br label [[FOR_COND25:%.*]] -; IS__CGSCC____: for.cond25: -; IS__CGSCC____-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__CGSCC____-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] -; IS__CGSCC____: for.cond.cleanup27: -; IS__CGSCC____-NEXT: br label [[FOR_END35:%.*]] -; IS__CGSCC____: for.body28: -; IS__CGSCC____-NEXT: [[ARRAYIDX30:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC____-NEXT: [[I19:%.*]] = load i8, i8* [[ARRAYIDX30]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC____-NEXT: store i8 [[I19]], i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: br label [[FOR_INC33]] -; IS__CGSCC____: for.inc33: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP27:![0-9]+]] -; IS__CGSCC____: for.end35: -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 +; IS__CGSCC_OPM-SAME: () #[[ATTR6:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] +; IS__CGSCC_OPM: for.cond: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] +; IS__CGSCC_OPM: for.body: +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] +; IS__CGSCC_OPM: for.inc: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]] +; IS__CGSCC_OPM: for.end: +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]] +; IS__CGSCC_OPM: for.cond2: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup4: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]] +; IS__CGSCC_OPM: for.body5: +; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]] +; IS__CGSCC_OPM: for.inc9: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]] +; IS__CGSCC_OPM: for.end11: +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]] +; IS__CGSCC_OPM: for.cond13: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup15: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END23:%.*]] +; IS__CGSCC_OPM: for.body16: +; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC21]] +; IS__CGSCC_OPM: for.inc21: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] +; IS__CGSCC_OPM: for.end23: +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR13]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND25:%.*]] +; IS__CGSCC_OPM: for.cond25: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup27: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END35:%.*]] +; IS__CGSCC_OPM: for.body28: +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC33]] +; IS__CGSCC_OPM: for.inc33: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]] +; IS__CGSCC_OPM: for.end35: +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_2 +; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; IS__CGSCC_NPM: for.cond: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; IS__CGSCC_NPM: for.body: +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 [[I]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] +; IS__CGSCC_NPM: for.inc: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]] +; IS__CGSCC_NPM: for.end: +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] +; IS__CGSCC_NPM: for.cond2: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup4: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] +; IS__CGSCC_NPM: for.body5: +; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = or i64 [[I15]], 1 +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* bitcast ([1024 x i8]* @GBytes to float*), i64 [[I16]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]] +; IS__CGSCC_NPM: for.inc9: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP22:![0-9]+]] +; IS__CGSCC_NPM: for.end11: +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] +; IS__CGSCC_NPM: for.cond13: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup15: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]] +; IS__CGSCC_NPM: for.body16: +; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = add nuw nsw i64 [[I17]], 2 +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* bitcast ([1024 x i8]* @GBytes to i64*), i64 [[I18]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC21]] +; IS__CGSCC_NPM: for.inc21: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP23:![0-9]+]] +; IS__CGSCC_NPM: for.end23: +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(524) bitcast (i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @GBytes, i64 0, i64 500) to i32*), i32 noundef 0) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND25:%.*]] +; IS__CGSCC_NPM: for.cond25: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC33:%.*]] ], [ 0, [[FOR_END23]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY28:%.*]], label [[FOR_COND_CLEANUP27:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup27: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END35:%.*]] +; IS__CGSCC_NPM: for.body28: +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC33]] +; IS__CGSCC_NPM: for.inc33: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND25]], !llvm.loop [[LOOP24:![0-9]+]] +; IS__CGSCC_NPM: for.end35: +; IS__CGSCC_NPM-NEXT: ret void ; entry: br label %for.cond @@ -1401,12 +1555,19 @@ ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] ; IS__TUNIT_NPM-NEXT: ret i32 [[I]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@static_global_simplifiable_3 -; IS__CGSCC____-SAME: () #[[ATTR5:[0-9]+]] { -; IS__CGSCC____-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: ret i32 [[I]] +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; IS__CGSCC_OPM-SAME: () #[[ATTR7:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: ret i32 [[I]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@static_global_simplifiable_3 +; IS__CGSCC_NPM-SAME: () #[[ATTR5:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: store i32 1, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag3, align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: ret i32 [[I]] ; store i32 1, i32* @Flag3, align 4, !tbaa !3 %i = load i32, i32* @Flag3, align 4, !tbaa !3 @@ -1531,55 +1692,105 @@ ; IS__TUNIT_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 -; IS__CGSCC____-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC____-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC____-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC____-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] -; IS__CGSCC____-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC____-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC____-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR9]] -; IS__CGSCC____-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR9]] -; IS__CGSCC____-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC____-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR9]] -; IS__CGSCC____-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC____-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 -; IS__CGSCC____-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC____-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 -; IS__CGSCC____-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] -; IS__CGSCC____-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 -; IS__CGSCC____-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 -; IS__CGSCC____-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] -; IS__CGSCC____-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 -; IS__CGSCC____-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC____-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 -; IS__CGSCC____-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] -; IS__CGSCC____-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] -; IS__CGSCC____-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 -; IS__CGSCC____-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] -; IS__CGSCC____-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC____-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] -; IS__CGSCC____-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 -; IS__CGSCC____-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] -; IS__CGSCC____-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 -; IS__CGSCC____-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC____-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 -; IS__CGSCC____-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 -; IS__CGSCC____-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] -; IS__CGSCC____-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 -; IS__CGSCC____-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] -; IS__CGSCC____-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 -; IS__CGSCC____-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] -; IS__CGSCC____-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] -; IS__CGSCC____-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 -; IS__CGSCC____-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 +; IS__CGSCC_OPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR8:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_OPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; IS__CGSCC_OPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] +; IS__CGSCC_OPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; IS__CGSCC_OPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR12]] +; IS__CGSCC_OPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_OPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_OPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] +; IS__CGSCC_OPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 +; IS__CGSCC_OPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; IS__CGSCC_OPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] +; IS__CGSCC_OPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_OPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] +; IS__CGSCC_OPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; IS__CGSCC_OPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] +; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] +; IS__CGSCC_OPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; IS__CGSCC_OPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] +; IS__CGSCC_OPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 +; IS__CGSCC_OPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; IS__CGSCC_OPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] +; IS__CGSCC_OPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; IS__CGSCC_OPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] +; IS__CGSCC_OPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_OPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] +; IS__CGSCC_OPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] +; IS__CGSCC_OPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; IS__CGSCC_OPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_1 +; IS__CGSCC_NPM-SAME: (%struct.S* noalias nocapture nofree nonnull writeonly sret([[STRUCT_S:%.*]]) align 4 dereferenceable(24) [[AGG_RESULT:%.*]], %struct.S* noalias nocapture nofree nonnull byval([[STRUCT_S]]) align 8 dereferenceable(24) [[S:%.*]]) #[[ATTR6:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[F1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: store float 0x3FF19999A0000000, float* [[F1]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_NPM-NEXT: [[F2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; IS__CGSCC_NPM-NEXT: store float 0x40019999A0000000, float* [[F2]], align 8, !tbaa [[TBAA10]] +; IS__CGSCC_NPM-NEXT: [[F3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; IS__CGSCC_NPM-NEXT: store float 0x400A666660000000, float* [[F3]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(24) [[I1]], i32 noundef 1) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(20) [[I2]], i32 noundef 2) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 8 dereferenceable(16) [[I3]], i32 noundef 3) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: [[F11:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = load float, float* [[F11]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_NPM-NEXT: [[F12:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: store float [[I]], float* [[F12]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_NPM-NEXT: [[F23:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 4 +; IS__CGSCC_NPM-NEXT: [[I4:%.*]] = load float, float* [[F23]], align 8, !tbaa [[TBAA10]] +; IS__CGSCC_NPM-NEXT: [[MUL:%.*]] = fmul float [[I4]], 2.000000e+00 +; IS__CGSCC_NPM-NEXT: [[F24:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 4 +; IS__CGSCC_NPM-NEXT: store float [[MUL]], float* [[F24]], align 4, !tbaa [[TBAA10]] +; IS__CGSCC_NPM-NEXT: [[F35:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 5 +; IS__CGSCC_NPM-NEXT: [[I5:%.*]] = load float, float* [[F35]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_NPM-NEXT: [[F16:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 3 +; IS__CGSCC_NPM-NEXT: [[I6:%.*]] = load float, float* [[F16]], align 4, !tbaa [[TBAA7]] +; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = fadd float [[I5]], [[I6]] +; IS__CGSCC_NPM-NEXT: [[F37:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 5 +; IS__CGSCC_NPM-NEXT: store float [[ADD]], float* [[F37]], align 4, !tbaa [[TBAA11]] +; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: [[I7:%.*]] = load i32, i32* [[I18]], align 8, !tbaa [[TBAA12]] +; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: store i32 [[I7]], i32* [[I19]], align 4, !tbaa [[TBAA12]] +; IS__CGSCC_NPM-NEXT: [[I210:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 1 +; IS__CGSCC_NPM-NEXT: [[I8:%.*]] = load i32, i32* [[I210]], align 4, !tbaa [[TBAA13]] +; IS__CGSCC_NPM-NEXT: [[MUL11:%.*]] = shl nsw i32 [[I8]], 1 +; IS__CGSCC_NPM-NEXT: [[I212:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 1 +; IS__CGSCC_NPM-NEXT: store i32 [[MUL11]], i32* [[I212]], align 4, !tbaa [[TBAA13]] +; IS__CGSCC_NPM-NEXT: [[I313:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 2 +; IS__CGSCC_NPM-NEXT: [[I9:%.*]] = load i32, i32* [[I313]], align 8, !tbaa [[TBAA14]] +; IS__CGSCC_NPM-NEXT: [[I114:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[S]], i64 0, i32 0 +; IS__CGSCC_NPM-NEXT: [[I10:%.*]] = load i32, i32* [[I114]], align 8, !tbaa [[TBAA12]] +; IS__CGSCC_NPM-NEXT: [[ADD15:%.*]] = add nsw i32 [[I9]], [[I10]] +; IS__CGSCC_NPM-NEXT: [[I316:%.*]] = getelementptr inbounds [[STRUCT_S]], %struct.S* [[AGG_RESULT]], i64 0, i32 2 +; IS__CGSCC_NPM-NEXT: store i32 [[ADD15]], i32* [[I316]], align 4, !tbaa [[TBAA14]] +; IS__CGSCC_NPM-NEXT: ret void ; entry: %f1 = getelementptr inbounds %struct.S, %struct.S* %s, i64 0, i32 3 @@ -1804,84 +2015,165 @@ ; IS__TUNIT_NPM: for.end37: ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 -; IS__CGSCC____-SAME: (i8* [[BYTES:%.*]]) { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: br label [[FOR_COND:%.*]] -; IS__CGSCC____: for.cond: -; IS__CGSCC____-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] -; IS__CGSCC____-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] -; IS__CGSCC____: for.cond.cleanup: -; IS__CGSCC____-NEXT: br label [[FOR_END:%.*]] -; IS__CGSCC____: for.body: -; IS__CGSCC____-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 -; IS__CGSCC____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] -; IS__CGSCC____-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: br label [[FOR_INC]] -; IS__CGSCC____: for.inc: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP28:![0-9]+]] -; IS__CGSCC____: for.end: -; IS__CGSCC____-NEXT: br label [[FOR_COND2:%.*]] -; IS__CGSCC____: for.cond2: -; IS__CGSCC____-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] -; IS__CGSCC____-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] -; IS__CGSCC____: for.cond.cleanup4: -; IS__CGSCC____-NEXT: br label [[FOR_END11:%.*]] -; IS__CGSCC____: for.body5: -; IS__CGSCC____-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* -; IS__CGSCC____-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 -; IS__CGSCC____-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 -; IS__CGSCC____-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] -; IS__CGSCC____-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA18]] -; IS__CGSCC____-NEXT: br label [[FOR_INC9]] -; IS__CGSCC____: for.inc9: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP29:![0-9]+]] -; IS__CGSCC____: for.end11: -; IS__CGSCC____-NEXT: br label [[FOR_COND13:%.*]] -; IS__CGSCC____: for.cond13: -; IS__CGSCC____-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] -; IS__CGSCC____-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] -; IS__CGSCC____: for.cond.cleanup15: -; IS__CGSCC____-NEXT: br label [[FOR_END23:%.*]] -; IS__CGSCC____: for.body16: -; IS__CGSCC____-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* -; IS__CGSCC____-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 -; IS__CGSCC____-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 -; IS__CGSCC____-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] -; IS__CGSCC____-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA20]] -; IS__CGSCC____-NEXT: br label [[FOR_INC21]] -; IS__CGSCC____: for.inc21: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] -; IS__CGSCC____: for.end23: -; IS__CGSCC____-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 -; IS__CGSCC____-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 -; IS__CGSCC____-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* -; IS__CGSCC____-NEXT: call void @write_arg(i32* nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR10]] -; IS__CGSCC____-NEXT: br label [[FOR_COND27:%.*]] -; IS__CGSCC____: for.cond27: -; IS__CGSCC____-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] -; IS__CGSCC____-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 -; IS__CGSCC____-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] -; IS__CGSCC____: for.cond.cleanup29: -; IS__CGSCC____-NEXT: br label [[FOR_END37:%.*]] -; IS__CGSCC____: for.body30: -; IS__CGSCC____-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] -; IS__CGSCC____-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] -; IS__CGSCC____-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA15]] -; IS__CGSCC____-NEXT: br label [[FOR_INC35]] -; IS__CGSCC____: for.inc35: -; IS__CGSCC____-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 -; IS__CGSCC____-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] -; IS__CGSCC____: for.end37: -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 +; IS__CGSCC_OPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR9:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND:%.*]] +; IS__CGSCC_OPM: for.cond: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END:%.*]] +; IS__CGSCC_OPM: for.body: +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] +; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC]] +; IS__CGSCC_OPM: for.inc: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] +; IS__CGSCC_OPM: for.end: +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2:%.*]] +; IS__CGSCC_OPM: for.cond2: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup4: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END11:%.*]] +; IS__CGSCC_OPM: for.body5: +; IS__CGSCC_OPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* +; IS__CGSCC_OPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_OPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] +; IS__CGSCC_OPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC9]] +; IS__CGSCC_OPM: for.inc9: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]] +; IS__CGSCC_OPM: for.end11: +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13:%.*]] +; IS__CGSCC_OPM: for.cond13: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup15: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END23:%.*]] +; IS__CGSCC_OPM: for.body16: +; IS__CGSCC_OPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* +; IS__CGSCC_OPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; IS__CGSCC_OPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] +; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC21]] +; IS__CGSCC_OPM: for.inc21: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] +; IS__CGSCC_OPM: for.end23: +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 +; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 +; IS__CGSCC_OPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* +; IS__CGSCC_OPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR13]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND27:%.*]] +; IS__CGSCC_OPM: for.cond27: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] +; IS__CGSCC_OPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; IS__CGSCC_OPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] +; IS__CGSCC_OPM: for.cond.cleanup29: +; IS__CGSCC_OPM-NEXT: br label [[FOR_END37:%.*]] +; IS__CGSCC_OPM: for.body30: +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] +; IS__CGSCC_OPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_OPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; IS__CGSCC_OPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_OPM-NEXT: br label [[FOR_INC35]] +; IS__CGSCC_OPM: for.inc35: +; IS__CGSCC_OPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; IS__CGSCC_OPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] +; IS__CGSCC_OPM: for.end37: +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@noalias_arg_simplifiable_2 +; IS__CGSCC_NPM-SAME: (i8* nocapture nofree [[BYTES:%.*]]) #[[ATTR5]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND:%.*]] +; IS__CGSCC_NPM: for.cond: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_INC:%.*]] ], [ 0, [[ENTRY:%.*]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV]], 100 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY:%.*]], label [[FOR_COND_CLEANUP:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END:%.*]] +; IS__CGSCC_NPM: for.body: +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = mul nuw nsw i64 [[INDVARS_IV]], 10 +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[I]] +; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC]] +; IS__CGSCC_NPM: for.inc: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND]], !llvm.loop [[LOOP25:![0-9]+]] +; IS__CGSCC_NPM: for.end: +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2:%.*]] +; IS__CGSCC_NPM: for.cond2: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV2:%.*]] = phi i64 [ [[INDVARS_IV_NEXT3:%.*]], [[FOR_INC9:%.*]] ], [ 0, [[FOR_END]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND6:%.*]] = icmp ne i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND6]], label [[FOR_BODY5:%.*]], label [[FOR_COND_CLEANUP4:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup4: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END11:%.*]] +; IS__CGSCC_NPM: for.body5: +; IS__CGSCC_NPM-NEXT: [[I15:%.*]] = bitcast i8* [[BYTES]] to float* +; IS__CGSCC_NPM-NEXT: [[I16:%.*]] = mul nuw nsw i64 [[INDVARS_IV2]], 10 +; IS__CGSCC_NPM-NEXT: [[I17:%.*]] = or i64 [[I16]], 1 +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX8:%.*]] = getelementptr inbounds float, float* [[I15]], i64 [[I17]] +; IS__CGSCC_NPM-NEXT: store float 0.000000e+00, float* [[ARRAYIDX8]], align 4, !tbaa [[TBAA26:![0-9]+]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC9]] +; IS__CGSCC_NPM: for.inc9: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT3]] = add nuw nsw i64 [[INDVARS_IV2]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND2]], !llvm.loop [[LOOP27:![0-9]+]] +; IS__CGSCC_NPM: for.end11: +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13:%.*]] +; IS__CGSCC_NPM: for.cond13: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV7:%.*]] = phi i64 [ [[INDVARS_IV_NEXT8:%.*]], [[FOR_INC21:%.*]] ], [ 0, [[FOR_END11]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND11:%.*]] = icmp ne i64 [[INDVARS_IV7]], 20 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND11]], label [[FOR_BODY16:%.*]], label [[FOR_COND_CLEANUP15:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup15: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END23:%.*]] +; IS__CGSCC_NPM: for.body16: +; IS__CGSCC_NPM-NEXT: [[I18:%.*]] = bitcast i8* [[BYTES]] to i64* +; IS__CGSCC_NPM-NEXT: [[I19:%.*]] = mul nuw nsw i64 [[INDVARS_IV7]], 10 +; IS__CGSCC_NPM-NEXT: [[I20:%.*]] = add nuw nsw i64 [[I19]], 2 +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX20:%.*]] = getelementptr inbounds i64, i64* [[I18]], i64 [[I20]] +; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX20]], align 8, !tbaa [[TBAA28:![0-9]+]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC21]] +; IS__CGSCC_NPM: for.inc21: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT8]] = add nuw nsw i64 [[INDVARS_IV7]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND13]], !llvm.loop [[LOOP30:![0-9]+]] +; IS__CGSCC_NPM: for.end23: +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX24:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 1023 +; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[ARRAYIDX24]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX25:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 500 +; IS__CGSCC_NPM-NEXT: [[I21:%.*]] = bitcast i8* [[ARRAYIDX25]] to i32* +; IS__CGSCC_NPM-NEXT: call void @write_arg(i32* nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[I21]], i32 noundef 0) #[[ATTR9]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND27:%.*]] +; IS__CGSCC_NPM: for.cond27: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV12:%.*]] = phi i64 [ [[INDVARS_IV_NEXT13:%.*]], [[FOR_INC35:%.*]] ], [ 0, [[FOR_END23]] ] +; IS__CGSCC_NPM-NEXT: [[EXITCOND14:%.*]] = icmp ne i64 [[INDVARS_IV12]], 1024 +; IS__CGSCC_NPM-NEXT: br i1 [[EXITCOND14]], label [[FOR_BODY30:%.*]], label [[FOR_COND_CLEANUP29:%.*]] +; IS__CGSCC_NPM: for.cond.cleanup29: +; IS__CGSCC_NPM-NEXT: br label [[FOR_END37:%.*]] +; IS__CGSCC_NPM: for.body30: +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX32:%.*]] = getelementptr inbounds i8, i8* [[BYTES]], i64 [[INDVARS_IV12]] +; IS__CGSCC_NPM-NEXT: [[I22:%.*]] = load i8, i8* [[ARRAYIDX32]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_NPM-NEXT: [[ARRAYIDX34:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* @globalBytes, i64 0, i64 [[INDVARS_IV12]] +; IS__CGSCC_NPM-NEXT: store i8 [[I22]], i8* [[ARRAYIDX34]], align 1, !tbaa [[TBAA19]] +; IS__CGSCC_NPM-NEXT: br label [[FOR_INC35]] +; IS__CGSCC_NPM: for.inc35: +; IS__CGSCC_NPM-NEXT: [[INDVARS_IV_NEXT13]] = add nuw nsw i64 [[INDVARS_IV12]], 1 +; IS__CGSCC_NPM-NEXT: br label [[FOR_COND27]], !llvm.loop [[LOOP31:![0-9]+]] +; IS__CGSCC_NPM: for.end37: +; IS__CGSCC_NPM-NEXT: ret void ; entry: br label %for.cond @@ -1991,30 +2283,30 @@ ; } ; define i32 @local_alloca_not_simplifiable_1() { -; NOT_TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { -; NOT_TUNIT_NPM-NEXT: entry: -; NOT_TUNIT_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 -; NOT_TUNIT_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 -; NOT_TUNIT_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* -; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8:[0-9]+]] -; NOT_TUNIT_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* -; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]] -; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; NOT_TUNIT_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] -; NOT_TUNIT_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* -; NOT_TUNIT_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) -; NOT_TUNIT_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) -; NOT_TUNIT_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] -; NOT_TUNIT_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 -; NOT_TUNIT_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 -; NOT_TUNIT_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] -; NOT_TUNIT_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] -; NOT_TUNIT_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] -; NOT_TUNIT_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* -; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) -; NOT_TUNIT_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* -; NOT_TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) -; NOT_TUNIT_NPM-NEXT: ret i32 [[ADD1]] +; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; IS__TUNIT_OPM-NEXT: entry: +; IS__TUNIT_OPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; IS__TUNIT_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 +; IS__TUNIT_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]] +; IS__TUNIT_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]] +; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS__TUNIT_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS__TUNIT_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; IS__TUNIT_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; IS__TUNIT_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; IS__TUNIT_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS__TUNIT_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; IS__TUNIT_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; IS__TUNIT_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS__TUNIT_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; IS__TUNIT_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; IS__TUNIT_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; IS__TUNIT_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; IS__TUNIT_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; IS__TUNIT_OPM-NEXT: ret i32 [[ADD1]] ; ; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { ; IS__TUNIT_NPM-NEXT: entry: @@ -2041,6 +2333,56 @@ ; IS__TUNIT_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) ; IS__TUNIT_NPM-NEXT: ret i32 [[ADD1]] ; +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: [[Y:%.*]] = alloca i32, align 4 +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR11]] +; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; IS__CGSCC_OPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; IS__CGSCC_OPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; IS__CGSCC_OPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; IS__CGSCC_OPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; IS__CGSCC_OPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; IS__CGSCC_OPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; IS__CGSCC_OPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; IS__CGSCC_OPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; IS__CGSCC_OPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; IS__CGSCC_OPM-NEXT: ret i32 [[ADD1]] +; +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@local_alloca_not_simplifiable_1() { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[X:%.*]] = alloca i32, align 4 +; IS__CGSCC_NPM-NEXT: [[Y:%.*]] = alloca i32, align 4 +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = bitcast i32* [[X]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: [[I1:%.*]] = bitcast i32* [[Y]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I1]]) #[[ATTR8]] +; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: [[I2:%.*]] = bitcast i32* [[X]] to i8* +; IS__CGSCC_NPM-NEXT: call void @escape(i8* noundef nonnull align 4 dereferenceable(4) [[I2]]) +; IS__CGSCC_NPM-NEXT: call void @write_random(i32* noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[Y]]) +; IS__CGSCC_NPM-NEXT: [[I3:%.*]] = load i32, i32* [[X]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[I3]], 0 +; IS__CGSCC_NPM-NEXT: [[COND:%.*]] = select i1 [[TOBOOL_NOT]], i32 2, i32 1 +; IS__CGSCC_NPM-NEXT: [[I4:%.*]] = load i32, i32* [[Y]], align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: [[ADD:%.*]] = add nsw i32 [[I3]], [[I4]] +; IS__CGSCC_NPM-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD]], [[COND]] +; IS__CGSCC_NPM-NEXT: [[I5:%.*]] = bitcast i32* [[Y]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I5]]) +; IS__CGSCC_NPM-NEXT: [[I6:%.*]] = bitcast i32* [[X]] to i8* +; IS__CGSCC_NPM-NEXT: call void @llvm.lifetime.end.p0i8(i64 noundef 4, i8* nocapture nofree noundef nonnull align 4 dereferenceable(4) [[I6]]) +; IS__CGSCC_NPM-NEXT: ret i32 [[ADD1]] +; entry: %X = alloca i32, align 4 %Y = alloca i32, align 4 @@ -2089,7 +2431,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_simplifiable -; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR2]] { +; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]]) #[[ATTR3]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 ; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* @@ -2152,7 +2494,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_access_mixed_not_simplifiable -; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR2]] { +; IS__CGSCC____-SAME: (i32 [[ARG1:%.*]], i32 [[ARG2:%.*]], i32 [[ARG3:%.*]]) #[[ATTR3]] { ; IS__CGSCC____-NEXT: entry: ; IS__CGSCC____-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 4 ; IS__CGSCC____-NEXT: [[BC:%.*]] = bitcast %struct.S* [[S]] to i32* @@ -2220,12 +2562,19 @@ ; IS__TUNIT_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] ; IS__TUNIT_NPM-NEXT: ret i32 [[I]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@global_not_simplifiable_1 -; IS__CGSCC____-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { -; IS__CGSCC____-NEXT: entry: -; IS__CGSCC____-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] -; IS__CGSCC____-NEXT: ret i32 [[I]] +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; IS__CGSCC_OPM-SAME: (i32 [[CND:%.*]]) #[[ATTR10:[0-9]+]] { +; IS__CGSCC_OPM-NEXT: entry: +; IS__CGSCC_OPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; IS__CGSCC_OPM-NEXT: ret i32 [[I]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@global_not_simplifiable_1 +; IS__CGSCC_NPM-SAME: (i32 [[CND:%.*]]) #[[ATTR7:[0-9]+]] { +; IS__CGSCC_NPM-NEXT: entry: +; IS__CGSCC_NPM-NEXT: [[I:%.*]] = load i32, i32* @Flag0, align 4, !tbaa [[TBAA3]] +; IS__CGSCC_NPM-NEXT: ret i32 [[I]] ; entry: %i = load i32, i32* @Flag0, align 4, !tbaa !3 @@ -2323,12 +2672,19 @@ ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_global -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gint1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@write_read_global +; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_OPM-NEXT: store i32 7, i32* @Gint1, align 4 +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; IS__CGSCC_OPM-NEXT: ret i32 [[L]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@write_read_global +; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_NPM-NEXT: store i32 7, i32* @Gint1, align 4 +; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint1, align 4 +; IS__CGSCC_NPM-NEXT: ret i32 [[L]] ; store i32 7, i32* @Gint1 %l = load i32, i32* @Gint1 @@ -2347,11 +2703,17 @@ ; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gint2, align 4 ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gint2, align 4 -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@write_global +; IS__CGSCC_OPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: store i32 7, i32* @Gint2, align 4 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@write_global +; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: store i32 7, i32* @Gint2, align 4 +; IS__CGSCC_NPM-NEXT: ret void ; store i32 7, i32* @Gint2 ret void @@ -2369,11 +2731,17 @@ ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_global -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@read_global +; IS__CGSCC_OPM-SAME: () #[[ATTR10]] { +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; IS__CGSCC_OPM-NEXT: ret i32 [[L]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@read_global +; IS__CGSCC_NPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gint2, align 4 +; IS__CGSCC_NPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @Gint2 ret i32 %l @@ -2394,12 +2762,19 @@ ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_global -; IS__CGSCC____-SAME: () #[[ATTR5]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int1, align 4 -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@write_read_static_global +; IS__CGSCC_OPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_OPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; IS__CGSCC_OPM-NEXT: ret i32 [[L]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@write_read_static_global +; IS__CGSCC_NPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_NPM-NEXT: store i32 7, i32* @Gstatic_int1, align 4 +; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int1, align 4 +; IS__CGSCC_NPM-NEXT: ret i32 [[L]] ; store i32 7, i32* @Gstatic_int1 %l = load i32, i32* @Gstatic_int1 @@ -2418,11 +2793,17 @@ ; IS__TUNIT_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_int2, align 4 -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@write_static_global +; IS__CGSCC_OPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@write_static_global +; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: store i32 7, i32* @Gstatic_int2, align 4 +; IS__CGSCC_NPM-NEXT: ret void ; store i32 7, i32* @Gstatic_int2 ret void @@ -2440,11 +2821,17 @@ ; IS__TUNIT_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 ; IS__TUNIT_NPM-NEXT: ret i32 [[L]] ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readonly willreturn -; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_global -; IS__CGSCC____-SAME: () #[[ATTR7]] { -; IS__CGSCC____-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 -; IS__CGSCC____-NEXT: ret i32 [[L]] +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@read_static_global +; IS__CGSCC_OPM-SAME: () #[[ATTR10]] { +; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; IS__CGSCC_OPM-NEXT: ret i32 [[L]] +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@read_static_global +; IS__CGSCC_NPM-SAME: () #[[ATTR7]] { +; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* @Gstatic_int2, align 4 +; IS__CGSCC_NPM-NEXT: ret i32 [[L]] ; %l = load i32, i32* @Gstatic_int2 ret i32 %l @@ -2460,10 +2847,15 @@ ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_NPM-NEXT: ret i32 7 ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_read_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: ret i32 7 +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@write_read_static_undef_global +; IS__CGSCC_OPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: ret i32 7 +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@write_read_static_undef_global +; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: ret i32 7 ; store i32 7, i32* @Gstatic_undef_int1 %l = load i32, i32* @Gstatic_undef_int1 @@ -2480,11 +2872,17 @@ ; IS__TUNIT_NPM-SAME: () #[[ATTR4]] { ; IS__TUNIT_NPM-NEXT: ret void ; -; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly -; IS__CGSCC____-LABEL: define {{[^@]+}}@write_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR4]] { -; IS__CGSCC____-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4 -; IS__CGSCC____-NEXT: ret void +; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@write_static_undef_global +; IS__CGSCC_OPM-SAME: () #[[ATTR5]] { +; IS__CGSCC_OPM-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4 +; IS__CGSCC_OPM-NEXT: ret void +; +; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly +; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@write_static_undef_global +; IS__CGSCC_NPM-SAME: () #[[ATTR4]] { +; IS__CGSCC_NPM-NEXT: store i32 7, i32* @Gstatic_undef_int2, align 4 +; IS__CGSCC_NPM-NEXT: ret void ; store i32 7, i32* @Gstatic_undef_int2 ret void @@ -2497,7 +2895,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@read_static_undef_global -; IS__CGSCC____-SAME: () #[[ATTR2]] { +; IS__CGSCC____-SAME: () #[[ATTR3]] { ; IS__CGSCC____-NEXT: ret i32 7 ; %l = load i32, i32* @Gstatic_undef_int2 @@ -2512,7 +2910,7 @@ ; ; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn ; IS__CGSCC____-LABEL: define {{[^@]+}}@single_read_of_static_global -; IS__CGSCC____-SAME: () #[[ATTR2]] { +; IS__CGSCC____-SAME: () #[[ATTR3]] { ; IS__CGSCC____-NEXT: ret i32 0 ; %l = load i32, i32* @Gstatic_int3 @@ -2574,81 +2972,62 @@ ; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind readonly willreturn } ; IS__TUNIT_NPM: attributes #[[ATTR6]] = { willreturn } ;. -; IS__CGSCC____: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind readnone willreturn } -; IS__CGSCC____: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } -; IS__CGSCC____: attributes #[[ATTR8]] = { willreturn } -; IS__CGSCC____: attributes #[[ATTR9]] = { nounwind willreturn writeonly } -; IS__CGSCC____: attributes #[[ATTR10]] = { nounwind writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nofree nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR6]] = { nofree norecurse nosync nounwind writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind } +; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR11]] = { willreturn } +; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes #[[ATTR13]] = { nounwind writeonly } ;. -; IS__TUNIT____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} -; IS__TUNIT____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} -; IS__TUNIT____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} -; IS__TUNIT____: [[TBAA3]] = !{!4, !4, i64 0} -; IS__TUNIT____: [[META4:![0-9]+]] = !{!"int", !5, i64 0} -; IS__TUNIT____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} -; IS__TUNIT____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} -; IS__TUNIT____: [[META7:![0-9]+]] = !{!8, !9, i64 12} -; IS__TUNIT____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} -; IS__TUNIT____: [[META9:![0-9]+]] = !{!"float", !5, i64 0} -; IS__TUNIT____: [[META10:![0-9]+]] = !{!8, !9, i64 16} -; IS__TUNIT____: [[META11:![0-9]+]] = !{!8, !9, i64 20} -; IS__TUNIT____: [[META12:![0-9]+]] = !{!8, !4, i64 0} -; IS__TUNIT____: [[META13:![0-9]+]] = !{!8, !4, i64 4} -; IS__TUNIT____: [[META14:![0-9]+]] = !{!8, !4, i64 8} -; IS__TUNIT____: [[META15:![0-9]+]] = distinct !{!15, !16} -; IS__TUNIT____: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"} -; IS__TUNIT____: [[META17:![0-9]+]] = distinct !{!17, !16} -; IS__TUNIT____: [[META18:![0-9]+]] = distinct !{!18, !16} -; IS__TUNIT____: [[META19:![0-9]+]] = !{!5, !5, i64 0} -; IS__TUNIT____: [[META20:![0-9]+]] = distinct !{!20, !16} -; IS__TUNIT____: [[META21:![0-9]+]] = distinct !{!21, !16} -; IS__TUNIT____: [[META22:![0-9]+]] = distinct !{!22, !16} -; IS__TUNIT____: [[META23:![0-9]+]] = distinct !{!23, !16} -; IS__TUNIT____: [[META24:![0-9]+]] = distinct !{!24, !16} -; IS__TUNIT____: [[META25:![0-9]+]] = distinct !{!25, !16} -; IS__TUNIT____: [[META26:![0-9]+]] = !{!9, !9, i64 0} -; IS__TUNIT____: [[META27:![0-9]+]] = distinct !{!27, !16} -; IS__TUNIT____: [[META28:![0-9]+]] = !{!29, !29, i64 0} -; IS__TUNIT____: [[META29:![0-9]+]] = !{!"long long", !5, i64 0} -; IS__TUNIT____: [[META30:![0-9]+]] = distinct !{!30, !16} -; IS__TUNIT____: [[META31:![0-9]+]] = distinct !{!31, !16} +; IS__CGSCC_NPM: attributes #[[ATTR0]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR1]] = { argmemonly nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes #[[ATTR5]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR8]] = { willreturn } +; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nounwind willreturn writeonly } ;. -; IS__CGSCC____: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} -; IS__CGSCC____: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} -; IS__CGSCC____: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} -; IS__CGSCC____: [[TBAA3]] = !{!4, !4, i64 0} -; IS__CGSCC____: [[META4:![0-9]+]] = !{!"int", !5, i64 0} -; IS__CGSCC____: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} -; IS__CGSCC____: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} -; IS__CGSCC____: [[TBAA7]] = !{!8, !9, i64 12} -; IS__CGSCC____: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} -; IS__CGSCC____: [[META9:![0-9]+]] = !{!"float", !5, i64 0} -; IS__CGSCC____: [[TBAA10]] = !{!8, !9, i64 16} -; IS__CGSCC____: [[TBAA11]] = !{!8, !9, i64 20} -; IS__CGSCC____: [[TBAA12]] = !{!8, !4, i64 0} -; IS__CGSCC____: [[TBAA13]] = !{!8, !4, i64 4} -; IS__CGSCC____: [[TBAA14]] = !{!8, !4, i64 8} -; IS__CGSCC____: [[TBAA15]] = !{!5, !5, i64 0} -; IS__CGSCC____: [[META16:![0-9]+]] = distinct !{!16, !17} -; IS__CGSCC____: [[META17:![0-9]+]] = !{!"llvm.loop.mustprogress"} -; IS__CGSCC____: [[TBAA18]] = !{!9, !9, i64 0} -; IS__CGSCC____: [[META19:![0-9]+]] = distinct !{!19, !17} -; IS__CGSCC____: [[TBAA20]] = !{!21, !21, i64 0} -; IS__CGSCC____: [[META21:![0-9]+]] = !{!"long long", !5, i64 0} -; IS__CGSCC____: [[META22:![0-9]+]] = distinct !{!22, !17} -; IS__CGSCC____: [[META23:![0-9]+]] = distinct !{!23, !17} -; IS__CGSCC____: [[LOOP24]] = distinct !{!24, !17} -; IS__CGSCC____: [[LOOP25]] = distinct !{!25, !17} -; IS__CGSCC____: [[LOOP26]] = distinct !{!26, !17} -; IS__CGSCC____: [[LOOP27]] = distinct !{!27, !17} -; IS__CGSCC____: [[LOOP28]] = distinct !{!28, !17} -; IS__CGSCC____: [[LOOP29]] = distinct !{!29, !17} -; IS__CGSCC____: [[LOOP30]] = distinct !{!30, !17} -; IS__CGSCC____: [[LOOP31]] = distinct !{!31, !17} +; CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} +; CHECK: [[META1:![0-9]+]] = !{i32 7, !"uwtable", i32 1} +; CHECK: [[META2:![0-9]+]] = !{!"clang version 13.0.0"} +; CHECK: [[TBAA3]] = !{!4, !4, i64 0} +; CHECK: [[META4:![0-9]+]] = !{!"int", !5, i64 0} +; CHECK: [[META5:![0-9]+]] = !{!"omnipotent char", !6, i64 0} +; CHECK: [[META6:![0-9]+]] = !{!"Simple C/C++ TBAA"} +; CHECK: [[META7:![0-9]+]] = !{!8, !9, i64 12} +; CHECK: [[META8:![0-9]+]] = !{!"S", !4, i64 0, !4, i64 4, !4, i64 8, !9, i64 12, !9, i64 16, !9, i64 20} +; CHECK: [[META9:![0-9]+]] = !{!"float", !5, i64 0} +; CHECK: [[META10:![0-9]+]] = !{!8, !9, i64 16} +; CHECK: [[META11:![0-9]+]] = !{!8, !9, i64 20} +; CHECK: [[META12:![0-9]+]] = !{!8, !4, i64 0} +; CHECK: [[META13:![0-9]+]] = !{!8, !4, i64 4} +; CHECK: [[META14:![0-9]+]] = !{!8, !4, i64 8} +; CHECK: [[META15:![0-9]+]] = distinct !{!15, !16} +; CHECK: [[META16:![0-9]+]] = !{!"llvm.loop.mustprogress"} +; CHECK: [[META17:![0-9]+]] = distinct !{!17, !16} +; CHECK: [[META18:![0-9]+]] = distinct !{!18, !16} +; CHECK: [[META19:![0-9]+]] = !{!5, !5, i64 0} +; CHECK: [[META20:![0-9]+]] = distinct !{!20, !16} +; CHECK: [[META21:![0-9]+]] = distinct !{!21, !16} +; CHECK: [[META22:![0-9]+]] = distinct !{!22, !16} +; CHECK: [[META23:![0-9]+]] = distinct !{!23, !16} +; CHECK: [[META24:![0-9]+]] = distinct !{!24, !16} +; CHECK: [[META25:![0-9]+]] = distinct !{!25, !16} +; CHECK: [[META26:![0-9]+]] = !{!9, !9, i64 0} +; CHECK: [[META27:![0-9]+]] = distinct !{!27, !16} +; CHECK: [[META28:![0-9]+]] = !{!29, !29, i64 0} +; CHECK: [[META29:![0-9]+]] = !{!"long long", !5, i64 0} +; CHECK: [[META30:![0-9]+]] = distinct !{!30, !16} +; CHECK: [[META31:![0-9]+]] = distinct !{!31, !16} ;. diff --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll --- a/llvm/test/Transforms/Attributor/value-simplify.ll +++ b/llvm/test/Transforms/Attributor/value-simplify.ll @@ -1040,8 +1040,8 @@ define void @test_callee_is_undef(void (i32)* %fn) { ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_callee_is_undef ; IS__TUNIT____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) { -; IS__TUNIT____-NEXT: call void @callee_is_undef() -; IS__TUNIT____-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]]) +; IS__TUNIT____-NEXT: call void @callee_is_undef(void ()* undef) +; IS__TUNIT____-NEXT: call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]], i32 undef) ; IS__TUNIT____-NEXT: ret void ; ; IS__CGSCC____-LABEL: define {{[^@]+}}@test_callee_is_undef @@ -1054,7 +1054,8 @@ } define internal void @callee_is_undef(void ()* %fn) { ; -; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_is_undef() { +; IS__TUNIT____-LABEL: define {{[^@]+}}@callee_is_undef +; IS__TUNIT____-SAME: (void ()* nocapture nofree noundef nonnull [[FN:%.*]]) { ; IS__TUNIT____-NEXT: call void undef() ; IS__TUNIT____-NEXT: ret void ; @@ -1068,10 +1069,15 @@ } define internal void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 %arg) { ; -; CHECK-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef -; CHECK-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) { -; CHECK-NEXT: call void [[FN]](i32 undef) -; CHECK-NEXT: ret void +; IS__TUNIT____-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef +; IS__TUNIT____-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]], i32 [[ARG:%.*]]) { +; IS__TUNIT____-NEXT: call void [[FN]](i32 undef) +; IS__TUNIT____-NEXT: ret void +; +; IS__CGSCC____-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef +; IS__CGSCC____-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) { +; IS__CGSCC____-NEXT: call void [[FN]](i32 undef) +; IS__CGSCC____-NEXT: ret void ; call void %fn(i32 %arg) ret void