Skip to content

Commit b35f28c

Browse files
committed
revert change to AttributorAttributes
1 parent b86394e commit b35f28c

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
116116
#include "llvm/Analysis/PostDominators.h"
117117
#include "llvm/Analysis/TargetLibraryInfo.h"
118-
#include "llvm/Analysis/TargetTransformInfo.h"
119118
#include "llvm/IR/AbstractCallSite.h"
120119
#include "llvm/IR/Attributes.h"
121120
#include "llvm/IR/ConstantRange.h"
@@ -1295,11 +1294,6 @@ struct InformationCache {
12951294
return AG.getAnalysis<TargetLibraryAnalysis>(F);
12961295
}
12971296

1298-
/// Return TargetLibraryInfo for function \p F.
1299-
TargetTransformInfo *getTargetTransformInfoForFunction(const Function &F) {
1300-
return AG.getAnalysis<TargetIRAnalysis>(F);
1301-
}
1302-
13031297
/// Return true if \p F has the "kernel" function attribute
13041298
bool isKernel(const Function &F) {
13051299
FunctionInfo &FI = getFunctionInfo(F);

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7350,7 +7350,8 @@ struct AAPrivatizablePtrArgument final : public AAPrivatizablePtrImpl {
73507350
// Verify callee and caller agree on how the promoted argument would be
73517351
// passed.
73527352
Function &Fn = *getIRPosition().getAnchorScope();
7353-
const auto *TTI = A.getInfoCache().getTargetTransformInfoForFunction(Fn);
7353+
const auto *TTI =
7354+
A.getInfoCache().getAnalysisResultForFunction<TargetIRAnalysis>(Fn);
73547355
if (!TTI) {
73557356
LLVM_DEBUG(dbgs() << "[AAPrivatizablePtr] Missing TTI for function "
73567357
<< Fn.getName() << "\n");
@@ -10210,18 +10211,8 @@ bool AANoUndef::isImpliedByIR(Attributor &A, const IRPosition &IRP,
1021010211
return true;
1021110212

1021210213
Value &Val = IRP.getAssociatedValue();
10213-
auto IsTargetGuaranteedNotPoison = [&](Value &V) {
10214-
if (auto *ASC = dyn_cast<AddrSpaceCastInst>(&V)) {
10215-
const auto *TTI = A.getInfoCache().getTargetTransformInfoForFunction(
10216-
*ASC->getFunction());
10217-
return ASC && TTI->isValidAddrSpaceCast(ASC->getSrcAddressSpace(),
10218-
ASC->getDestAddressSpace());
10219-
}
10220-
return false;
10221-
};
1022210214
if (IRP.getPositionKind() != IRPosition::IRP_RETURNED &&
10223-
(isGuaranteedNotToBeUndefOrPoison(&Val) ||
10224-
IsTargetGuaranteedNotPoison(Val))) {
10215+
isGuaranteedNotToBeUndefOrPoison(&Val)) {
1022510216
LLVMContext &Ctx = Val.getContext();
1022610217
A.manifestAttrs(IRP, Attribute::get(Ctx, Attribute::NoUndef));
1022710218
return true;
@@ -12961,7 +12952,8 @@ struct AAAddressSpaceImpl : public AAAddressSpace {
1296112952

1296212953
// Use getAssumedAddrSpace if the associated function exists.
1296312954
if (F) {
12964-
auto *TTI = A.getInfoCache().getTargetTransformInfoForFunction(*F);
12955+
auto *TTI =
12956+
A.getInfoCache().getAnalysisResultForFunction<TargetIRAnalysis>(*F);
1296512957
unsigned AssumedAS = TTI->getAssumedAddrSpace(&Obj);
1296612958
if (AssumedAS != ~0U)
1296712959
return takeAddressSpace(AssumedAS);

llvm/test/Transforms/Attributor/reduced/aapointer_info_map_invalidation.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes
2-
; RUN: opt -mtriple=amdgcn-amd-amdhsa -passes=attributor -S < %s | FileCheck %s --check-prefixes=CHECK
2+
; RUN: opt -passes=attributor -S < %s | FileCheck %s --check-prefixes=CHECK
33

44
define amdgpu_kernel void @__omp_offloading_fd00_2c00523__ZN11qmcplusplus7ompBLAS9gemv_implIfEEiRiciiT_PKS3_iS5_iS3_PS3_i_l383() {
55
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
@@ -8,7 +8,7 @@ define amdgpu_kernel void @__omp_offloading_fd00_2c00523__ZN11qmcplusplus7ompBLA
88
; CHECK-NEXT: [[TMP1:%.*]] = alloca [0 x [0 x float]], i32 0, align 8, addrspace(5)
99
; CHECK-NEXT: [[TMP2:%.*]] = addrspacecast ptr addrspace(5) [[TMP1]] to ptr
1010
; CHECK-NEXT: store ptr [[TMP2]], ptr addrspace(5) [[TMP1]], align 8
11-
; CHECK-NEXT: [[TMP3:%.*]] = call fastcc i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(ptr nofree noundef readonly align 8 captures(none) dereferenceable_or_null(8) [[TMP2]], i1 noundef false)
11+
; CHECK-NEXT: [[TMP3:%.*]] = call fastcc i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(ptr nofree readonly align 8 captures(none) dereferenceable_or_null(8) [[TMP2]], i1 noundef false)
1212
; CHECK-NEXT: ret void
1313
;
1414
%1 = alloca [0 x [0 x float]], i32 0, align 8, addrspace(5)

0 commit comments

Comments
 (0)