[llvm] r328885 - [NVPTX] Enable StructuredCFG for NVPTX
Tim Shen via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 30 10:51:03 PDT 2018
Author: timshen
Date: Fri Mar 30 10:51:03 2018
New Revision: 328885
URL: http://llvm.org/viewvc/llvm-project?rev=328885&view=rev
Log:
[NVPTX] Enable StructuredCFG for NVPTX
Summary:
Make NVPTX require structured CFG. Added a temporary flag to
"roll back" the behavior for easy deployment.
Combined with D45008, this fixes several internal Nvidia GPU test
failures that we suspect to be ptxas miscompiles (PR27738).
Reviewers: jlebar
Subscribers: jholewinski, sanjoy, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D45070
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp?rev=328885&r1=328884&r2=328885&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp Fri Mar 30 10:51:03 2018
@@ -44,6 +44,14 @@ static cl::opt<bool>
cl::desc("Disable load/store vectorizer"),
cl::init(false), cl::Hidden);
+// TODO: Remove this flag when we are confident with no regressions.
+static cl::opt<bool> DisableRequireStructuredCFG(
+ "disable-nvptx-require-structured-cfg",
+ cl::desc("Transitional flag to turn off NVPTX's requirement on preserving "
+ "structured CFG. The requirement should be disabled only when "
+ "unexpected regressions happen."),
+ cl::init(false), cl::Hidden);
+
namespace llvm {
void initializeNVVMIntrRangePass(PassRegistry&);
@@ -108,6 +116,8 @@ NVPTXTargetMachine::NVPTXTargetMachine(c
drvInterface = NVPTX::NVCL;
else
drvInterface = NVPTX::CUDA;
+ if (!DisableRequireStructuredCFG)
+ setRequiresStructuredCFG(true);
initAsmInfo();
}
More information about the llvm-commits
mailing list