9
9
// ===----------------------------------------------------------------------===//
10
10
11
11
#include " llvm/SYCLLowerIR/SpecConstants.h"
12
- #include " llvm/IR/DerivedTypes.h"
13
12
#include " llvm/SYCLLowerIR/Support.h"
14
- #include " llvm/SYCLLowerIR/UtilsSYCLNativeCPU.h"
15
13
16
14
#include " llvm/ADT/APInt.h"
17
15
#include " llvm/ADT/StringMap.h"
@@ -939,7 +937,6 @@ PreservedAnalyses SpecConstantsPass::run(Module &M,
939
937
unsigned Size = M.getDataLayout ().getTypeStoreSize (SCTy);
940
938
uint64_t Align = M.getDataLayout ().getABITypeAlign (SCTy).value ();
941
939
942
-
943
940
// Ensure correct alignment
944
941
if (CurrentOffset % Align != 0 ) {
945
942
// Compute necessary padding to correctly align the constant.
@@ -954,14 +951,9 @@ PreservedAnalyses SpecConstantsPass::run(Module &M,
954
951
updatePaddingInLastMDNode (Ctx, SCMetadata, Padding);
955
952
}
956
953
957
- if (sycl::utils::isSYCLNativeCPU (M) && isa<StructType>(DefaultValue->getType ())) {
958
- auto STy = cast<StructType>(DefaultValue->getType ());
959
- SCMetadata[SymID] = generateSpecConstantMetadata (
960
- M, SymID, STy, NextID, /* is native spec constant */ false );
961
- } else {
962
- SCMetadata[SymID] = generateSpecConstantMetadata (
963
- M, SymID, SCTy, NextID, /* is native spec constant */ false );
964
- }
954
+ auto *DefValTy = DefaultValue->getType ();
955
+ SCMetadata[SymID] = generateSpecConstantMetadata (
956
+ M, SymID, DefValTy, NextID, /* is native spec constant */ false );
965
957
966
958
++NextID.ID ;
967
959
NextOffset += Size;
0 commit comments