[Autobackout][FuncReg]Revert of change: 1c28c742da

Fix build with LLVM 12

Removed TargetLibraryInfo.h include from AddressSpaceAliasAnalysis.cpp
as this was causing treat-warning-as-error buildbreak,
Added casts to fix warnings,
Replaced ConstantPropagation and IPConstantPropagation passes with
IPSCCP passes,
reasoning here:
https://lists.llvm.org/pipermail/llvm-dev/2020-July/143788.html

Original pull-request:
intel/intel-graphics-compiler#171

Signed-off-by: Zoltán Böszörményi zboszor@gmail.com
Co-authored-by: Pawel Szymichowski pawel.szymichowski@intel.com

Co-authored-by: Zoltán Böszörményi zboszor@pr.hu
This commit is contained in:
Zoltán Böszörményi
2021-04-26 11:10:59 -07:00
committed by igcbot
parent f7267a3557
commit 32944e60e9
67 changed files with 201 additions and 269 deletions

View File

@ -28,7 +28,6 @@ IN THE SOFTWARE.
#include "Compiler/CodeGenPublic.h"
#include "common/LLVMWarningsPush.hpp"
#include <llvm/Support/Debug.h>
#include "llvmWrapper/IR/DerivedTypes.h"
#include "common/LLVMWarningsPop.hpp"
#include <algorithm>
#include "Probe/Assertion.h"
@ -41,13 +40,13 @@ namespace
// If V is scalar, return 1.
// if V is vector, return the number of elements.
inline int getNumElts(Value* V) {
IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(V->getType());
VectorType* VTy = dyn_cast<VectorType>(V->getType());
return VTy ? (int)VTy->getNumElements() : 1;
}
inline int getTypeSizeInBits(Type* Ty) {
int scalarBits = Ty->getScalarSizeInBits();
IGCLLVM::FixedVectorType* VTy = dyn_cast<IGCLLVM::FixedVectorType>(Ty);
VectorType* VTy = dyn_cast<VectorType>(Ty);
return scalarBits * (VTy ? (int)VTy->getNumElements() : 1);
}
}