Skip to content

Commit b0b32e6

Browse files
author
sstefan1
committed
[OpenMPOpt] ICV tracking for calls
Introduce two new AAs. AAICVTrackerFunctionReturned which checks if a function can have a unique ICV value after it is finished, and AAICVCallSiteReturned which checks AAICVTrackerFunctionReturned for a call site. This enables us to check the value of a call and if it changes the ICV. This also changes the approach in `getReplacementValues()` to a worklist-based approach so we can explore all relevant BBs. Differential Revision: https://reviews.llvm.org/D85544
1 parent eedf18f commit b0b32e6

File tree

3 files changed

+889
-116
lines changed

3 files changed

+889
-116
lines changed

llvm/lib/Transforms/IPO/Attributor.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,13 +901,15 @@ bool Attributor::checkForAllInstructions(function_ref<bool(Instruction &)> Pred,
901901

902902
// TODO: use the function scope once we have call site AAReturnedValues.
903903
const IRPosition &QueryIRP = IRPosition::function(*AssociatedFunction);
904-
const auto &LivenessAA =
905-
getAAFor<AAIsDead>(QueryingAA, QueryIRP, /* TrackDependence */ false);
904+
const auto *LivenessAA =
905+
CheckBBLivenessOnly ? nullptr
906+
: &(getAAFor<AAIsDead>(QueryingAA, QueryIRP,
907+
/* TrackDependence */ false));
906908

907909
auto &OpcodeInstMap =
908910
InfoCache.getOpcodeInstMapForFunction(*AssociatedFunction);
909911
if (!checkForAllInstructionsImpl(this, OpcodeInstMap, Pred, &QueryingAA,
910-
&LivenessAA, Opcodes, CheckBBLivenessOnly))
912+
LivenessAA, Opcodes, CheckBBLivenessOnly))
911913
return false;
912914

913915
return true;

0 commit comments

Comments
 (0)