[llvm] e84a465 - [NVPTX][NewPM] Re-enable NVVMReflectPass
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 8 13:58:31 PST 2021
Author: Arthur Eubanks
Date: 2021-02-08T13:58:17-08:00
New Revision: e84a4650eb7ecd5d2e3b266d63d2f7ed83d49f98
URL: https://github.com/llvm/llvm-project/commit/e84a4650eb7ecd5d2e3b266d63d2f7ed83d49f98
DIFF: https://github.com/llvm/llvm-project/commit/e84a4650eb7ecd5d2e3b266d63d2f7ed83d49f98.diff
LOG: [NVPTX][NewPM] Re-enable NVVMReflectPass
Disabled alongside NVVMIntrRangePass in https://reviews.llvm.org/D96166,
but turns out NVVMIntrRangePass was the issue.
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D96291
Added:
Modified:
llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
llvm/test/CodeGen/NVPTX/nvvm-reflect-arch.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
index 21588385292b..3a31b3bee5a5 100644
--- a/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
@@ -222,17 +222,16 @@ void NVPTXTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB,
return false;
});
- // FIXME: these passes are causing numerical discrepancies, investigate and
- // re-enable.
-
- // PB.registerPipelineStartEPCallback(
- // [this, DebugPassManager](ModulePassManager &PM,
- // PassBuilder::OptimizationLevel Level) {
- // FunctionPassManager FPM(DebugPassManager);
- // FPM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
- // FPM.addPass(NVVMIntrRangePass(Subtarget.getSmVersion()));
- // PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
- // });
+ PB.registerPipelineStartEPCallback(
+ [this, DebugPassManager](ModulePassManager &PM,
+ PassBuilder::OptimizationLevel Level) {
+ FunctionPassManager FPM(DebugPassManager);
+ FPM.addPass(NVVMReflectPass(Subtarget.getSmVersion()));
+ // FIXME: NVVMIntrRangePass is causing numerical discrepancies,
+ // investigate and re-enable.
+ // FPM.addPass(NVVMIntrRangePass(Subtarget.getSmVersion()));
+ PM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM)));
+ });
}
TargetTransformInfo
diff --git a/llvm/test/CodeGen/NVPTX/nvvm-reflect-arch.ll b/llvm/test/CodeGen/NVPTX/nvvm-reflect-arch.ll
index faab35525f76..8e8d866504de 100644
--- a/llvm/test/CodeGen/NVPTX/nvvm-reflect-arch.ll
+++ b/llvm/test/CodeGen/NVPTX/nvvm-reflect-arch.ll
@@ -1,10 +1,9 @@
; Libdevice in recent CUDA versions relies on __CUDA_ARCH reflecting GPU type.
; Verify that __nvvm_reflect() is replaced with an appropriate value.
;
-; FIXME: fix pass and re-enable under new PM
-; RUN: opt %s -S -nvvm-reflect -O2 -enable-new-pm=0 -mtriple=nvptx64 \
+; RUN: opt %s -S -nvvm-reflect -O2 -mtriple=nvptx64 \
; RUN: | FileCheck %s --check-prefixes=COMMON,SM20
-; RUN: opt %s -S -nvvm-reflect -O2 -enable-new-pm=0 -mtriple=nvptx64 -mcpu=sm_35 \
+; RUN: opt %s -S -nvvm-reflect -O2 -mtriple=nvptx64 -mcpu=sm_35 \
; RUN: | FileCheck %s --check-prefixes=COMMON,SM35
@"$str" = private addrspace(1) constant [12 x i8] c"__CUDA_ARCH\00"
More information about the llvm-commits
mailing list