diff options
author | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2020-03-13 10:58:19 -0700 |
---|---|---|
committer | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2020-03-13 12:33:22 -0700 |
commit | 32e90cbcd19a83e20a86bfc1cbf7cec9729e9077 (patch) | |
tree | cdb90eaad41d345cda475fc3e13667452d9e8b93 /llvm/lib | |
parent | 994c071a1b7eee8de132d78286c730da2be2c48f (diff) | |
download | llvm-32e90cbcd19a83e20a86bfc1cbf7cec9729e9077.zip llvm-32e90cbcd19a83e20a86bfc1cbf7cec9729e9077.tar.gz llvm-32e90cbcd19a83e20a86bfc1cbf7cec9729e9077.tar.bz2 |
[AMDGPU] Disable endcf collapse
There are some functional regressions and I suspect our
scopes are not as perfectly enclosed as I expected.
Disable it for now.
Differential Revision: https://reviews.llvm.org/D76148
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp b/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp index 6e617df..de9d8fa 100644 --- a/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp +++ b/llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp @@ -74,6 +74,10 @@ using namespace llvm; #define DEBUG_TYPE "si-lower-control-flow" +static cl::opt<bool> +RemoveRedundantEndcf("amdgpu-remove-redundant-endcf", + cl::init(false), cl::ReallyHidden); + namespace { class SILowerControlFlow : public MachineFunctionPass { @@ -444,14 +448,17 @@ void SILowerControlFlow::emitEndCf(MachineInstr &MI) { // If the only instruction immediately following this END_CF is an another // END_CF in the only successor we can avoid emitting exec mask restore here. - auto Next = skipIgnoreExecInstsTrivialSucc(MBB, std::next(MI.getIterator())); - if (Next != MBB.end() && (Next->getOpcode() == AMDGPU::SI_END_CF || - LoweredEndCf.count(&*Next))) { - LLVM_DEBUG(dbgs() << "Skip redundant "; MI.dump()); - if (LIS) - LIS->RemoveMachineInstrFromMaps(MI); - MI.eraseFromParent(); - return; + if (RemoveRedundantEndcf) { + auto Next = + skipIgnoreExecInstsTrivialSucc(MBB, std::next(MI.getIterator())); + if (Next != MBB.end() && (Next->getOpcode() == AMDGPU::SI_END_CF || + LoweredEndCf.count(&*Next))) { + LLVM_DEBUG(dbgs() << "Skip redundant "; MI.dump()); + if (LIS) + LIS->RemoveMachineInstrFromMaps(MI); + MI.eraseFromParent(); + return; + } } MachineBasicBlock::iterator InsPt = |