Skip to content

Commit dce52b4

Browse files
committed
Revert "AMDGPU: Move placement of RemoveIncompatibleFunctions"
This reverts commit 5b5bd81.
1 parent aef58ce commit dce52b4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,6 @@ void AMDGPUPassConfig::addStraightLineScalarOptimizationPasses() {
982982
void AMDGPUPassConfig::addIRPasses() {
983983
const AMDGPUTargetMachine &TM = getAMDGPUTargetMachine();
984984

985-
Triple::ArchType Arch = TM.getTargetTriple().getArch();
986-
if (RemoveIncompatibleFunctions && Arch == Triple::amdgcn)
987-
addPass(createAMDGPURemoveIncompatibleFunctionsPass(&TM));
988-
989985
// There is no reason to run these.
990986
disablePass(&StackMapLivenessID);
991987
disablePass(&FuncletLayoutID);
@@ -1000,7 +996,7 @@ void AMDGPUPassConfig::addIRPasses() {
1000996
addPass(createAlwaysInlinerLegacyPass());
1001997

1002998
// Handle uses of OpenCL image2d_t, image3d_t and sampler_t arguments.
1003-
if (Arch == Triple::r600)
999+
if (TM.getTargetTriple().getArch() == Triple::r600)
10041000
addPass(createR600OpenCLImageTypeLoweringPass());
10051001

10061002
// Replace OpenCL enqueued block function pointers with global variables.
@@ -1075,6 +1071,9 @@ void AMDGPUPassConfig::addIRPasses() {
10751071

10761072
void AMDGPUPassConfig::addCodeGenPrepare() {
10771073
if (TM->getTargetTriple().getArch() == Triple::amdgcn) {
1074+
if (RemoveIncompatibleFunctions)
1075+
addPass(createAMDGPURemoveIncompatibleFunctionsPass(TM));
1076+
10781077
// FIXME: This pass adds 2 hacky attributes that can be replaced with an
10791078
// analysis, and should be removed.
10801079
addPass(createAMDGPUAnnotateKernelFeaturesPass());

llvm/test/CodeGen/AMDGPU/llc-pipeline.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
; GCN-O0-NEXT: FunctionPass Manager
2929
; GCN-O0-NEXT: Expand large div/rem
3030
; GCN-O0-NEXT: Expand large fp convert
31-
; GCN-O0-NEXT: AMDGPU Remove Incompatible Functions
3231
; GCN-O0-NEXT: AMDGPU Printf lowering
3332
; GCN-O0-NEXT: Lower ctors and dtors for AMDGPU
3433
; GCN-O0-NEXT: AMDGPU Inline All Functions
@@ -50,6 +49,7 @@
5049
; GCN-O0-NEXT: SYCL Add Implicit Global Offset
5150
; GCN-O0-NEXT: FunctionPass Manager
5251
; GCN-O0-NEXT: FPBuiltin Function Selection
52+
; GCN-O0-NEXT: AMDGPU Remove Incompatible Functions
5353
; GCN-O0-NEXT: CallGraph Construction
5454
; GCN-O0-NEXT: Call Graph SCC Pass Manager
5555
; GCN-O0-NEXT: AMDGPU Annotate Kernel Features
@@ -174,7 +174,6 @@
174174
; GCN-O1-NEXT: FunctionPass Manager
175175
; GCN-O1-NEXT: Expand large div/rem
176176
; GCN-O1-NEXT: Expand large fp convert
177-
; GCN-O1-NEXT: AMDGPU Remove Incompatible Functions
178177
; GCN-O1-NEXT: AMDGPU Printf lowering
179178
; GCN-O1-NEXT: Lower ctors and dtors for AMDGPU
180179
; GCN-O1-NEXT: AMDGPU Inline All Functions
@@ -230,6 +229,7 @@
230229
; GCN-O1-NEXT: SYCL Add Implicit Global Offset
231230
; GCN-O1-NEXT: FunctionPass Manager
232231
; GCN-O1-NEXT: FPBuiltin Function Selection
232+
; GCN-O1-NEXT: AMDGPU Remove Incompatible Functions
233233
; GCN-O1-NEXT: CallGraph Construction
234234
; GCN-O1-NEXT: Call Graph SCC Pass Manager
235235
; GCN-O1-NEXT: AMDGPU Annotate Kernel Features
@@ -450,7 +450,6 @@
450450
; GCN-O1-OPTS-NEXT: FunctionPass Manager
451451
; GCN-O1-OPTS-NEXT: Expand large div/rem
452452
; GCN-O1-OPTS-NEXT: Expand large fp convert
453-
; GCN-O1-OPTS-NEXT: AMDGPU Remove Incompatible Functions
454453
; GCN-O1-OPTS-NEXT: AMDGPU Printf lowering
455454
; GCN-O1-OPTS-NEXT: Lower ctors and dtors for AMDGPU
456455
; GCN-O1-OPTS-NEXT: AMDGPU Inline All Functions
@@ -514,6 +513,7 @@
514513
; GCN-O1-OPTS-NEXT: SYCL Add Implicit Global Offset
515514
; GCN-O1-OPTS-NEXT: FunctionPass Manager
516515
; GCN-O1-OPTS-NEXT: FPBuiltin Function Selection
516+
; GCN-O1-OPTS-NEXT: AMDGPU Remove Incompatible Functions
517517
; GCN-O1-OPTS-NEXT: CallGraph Construction
518518
; GCN-O1-OPTS-NEXT: Call Graph SCC Pass Manager
519519
; GCN-O1-OPTS-NEXT: AMDGPU Annotate Kernel Features
@@ -748,7 +748,6 @@
748748
; GCN-O2-NEXT: FunctionPass Manager
749749
; GCN-O2-NEXT: Expand large div/rem
750750
; GCN-O2-NEXT: Expand large fp convert
751-
; GCN-O2-NEXT: AMDGPU Remove Incompatible Functions
752751
; GCN-O2-NEXT: AMDGPU Printf lowering
753752
; GCN-O2-NEXT: Lower ctors and dtors for AMDGPU
754753
; GCN-O2-NEXT: AMDGPU Inline All Functions
@@ -820,6 +819,7 @@
820819
; GCN-O2-NEXT: SYCL Add Implicit Global Offset
821820
; GCN-O2-NEXT: FunctionPass Manager
822821
; GCN-O2-NEXT: FPBuiltin Function Selection
822+
; GCN-O2-NEXT: AMDGPU Remove Incompatible Functions
823823
; GCN-O2-NEXT: CallGraph Construction
824824
; GCN-O2-NEXT: Call Graph SCC Pass Manager
825825
; GCN-O2-NEXT: AMDGPU Annotate Kernel Features
@@ -1056,7 +1056,6 @@
10561056
; GCN-O3-NEXT: FunctionPass Manager
10571057
; GCN-O3-NEXT: Expand large div/rem
10581058
; GCN-O3-NEXT: Expand large fp convert
1059-
; GCN-O3-NEXT: AMDGPU Remove Incompatible Functions
10601059
; GCN-O3-NEXT: AMDGPU Printf lowering
10611060
; GCN-O3-NEXT: Lower ctors and dtors for AMDGPU
10621061
; GCN-O3-NEXT: AMDGPU Inline All Functions
@@ -1140,6 +1139,7 @@
11401139
; GCN-O3-NEXT: SYCL Add Implicit Global Offset
11411140
; GCN-O3-NEXT: FunctionPass Manager
11421141
; GCN-O3-NEXT: FPBuiltin Function Selection
1142+
; GCN-O3-NEXT: AMDGPU Remove Incompatible Functions
11431143
; GCN-O3-NEXT: CallGraph Construction
11441144
; GCN-O3-NEXT: Call Graph SCC Pass Manager
11451145
; GCN-O3-NEXT: AMDGPU Annotate Kernel Features

0 commit comments

Comments
 (0)