The patch adds the regularization pass that prepare LLVM IR for the IR translation. It also implements a few small improvements and fixes some bugs:
- reduce code indentation, make getNonParametrizedType, getSamplerType, getPipeType, getImageType, getSampledImageType static (SPIRVBuiltins.cpp),
- rename mayBeOclOrSpirvBuiltin to getOclOrSpirvBuiltinDemangledName (SPIRVUtils.cpp),
- move isOpenCLBuiltinType, isSPIRVBuiltinType, isSpecialType from SPIRVGlobalRegistry.cpp to SPIRVUtils.cpp, renaming isSpecialType to isSpecialOpaqueType,
- implment getTgtMemIntrinsic() in SPIRVISelLowering,
- add hasSideEffects = 0 in Pseudo (SPIRVInstrFormats.td),
- add legalization rule for G_MEMSET, correct G_BRCOND rule (SPIRVLegalizerInfo.cpp),
- add capability processing for OpBuildNDRange (SPIRVModuleAnalysis.cpp),
- don't correct type of register holding constant and used in G_ADDRSPACE_CAST (SPIRVPreLegalizer.cpp),
- lower memset/bswap intrinsics to functions (SPIRVPrepareFunctions.cpp),
- change TLOF from TargetLoweringObjectFileELF to SPIRVTargetObjectFile (SPIRVTargetMachine.cpp),
- correct comments.
5 LIT tests are added to show the improvement.
Pls remove tabs