mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
R600: Use StructurizeCFGPass for non SI targets
StructurizeCFG pass allows to make complex cfg reducible ; it allows a lot of shader from shadertoy (which exhibits complex control flow constructs) to works correctly with respect to CFG handling (and allow us to detect potential bug in other part of the backend). We provide a cmd line argument to disable the pass for debug purpose. Patch by: Vincent Lejeune Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192363 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include "llvm/Transforms/Scalar.h"
|
||||
#include <llvm/CodeGen/Passes.h>
|
||||
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
extern "C" void LLVMInitializeR600Target() {
|
||||
@ -123,9 +124,11 @@ bool
|
||||
AMDGPUPassConfig::addPreISel() {
|
||||
const AMDGPUSubtarget &ST = TM->getSubtarget<AMDGPUSubtarget>();
|
||||
addPass(createFlattenCFGPass());
|
||||
if (ST.IsIRStructurizerEnabled() ||
|
||||
ST.getGeneration() > AMDGPUSubtarget::NORTHERN_ISLANDS)
|
||||
addPass(createStructurizeCFGPass());
|
||||
if (ST.getGeneration() > AMDGPUSubtarget::NORTHERN_ISLANDS) {
|
||||
addPass(createSITypeRewriter());
|
||||
addPass(createStructurizeCFGPass());
|
||||
addPass(createSIAnnotateControlFlowPass());
|
||||
} else {
|
||||
addPass(createR600TextureIntrinsicsReplacer());
|
||||
|
Reference in New Issue
Block a user