llvm-project/llvm/lib/Target/DirectX/DXILDataScalarization.h
Farzon Lotfi 324bdd662d
[DirectX] Data Scalarization of Vectors in Global Scope (#110029)
This change adds a pass to scalarize vectors in global scope into
arrays.

There are three distinct parts
1. find the globals that need to be updated and define what the new type
should be
2. initialize that new type and copy over all the right attributes over
from the old type.
3. Use the instruction visitor pattern to update the loads, stores, and
geps for the layout of the new data structure.

resolves https://github.com/llvm/llvm-project/issues/107920
2024-09-26 17:16:29 -04:00

26 lines
843 B
C++

//===- DXILDataScalarization.h - Perform DXIL Data Legalization -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------------------------------------------------===//
#ifndef LLVM_TARGET_DIRECTX_DXILDATASCALARIZATION_H
#define LLVM_TARGET_DIRECTX_DXILDATASCALARIZATION_H
#include "DXILResource.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
namespace llvm {
/// A pass that transforms Vectors to Arrays
class DXILDataScalarization : public PassInfoMixin<DXILDataScalarization> {
public:
PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
};
} // namespace llvm
#endif // LLVM_TARGET_DIRECTX_DXILDATASCALARIZATION_H