diff options
author | Joseph Huber <huberjn@outlook.com> | 2023-12-07 16:54:40 -0600 |
---|---|---|
committer | Joseph Huber <huberjn@outlook.com> | 2023-12-07 16:55:14 -0600 |
commit | bfd41c3f8cc70bd65461a6d767f55c14d72150d9 (patch) | |
tree | c537de018ed8c11cc4567fbd1b0f63c25f0e02a1 | |
parent | c6805ea44af3bfd57e6b46f2d65ec6b0d0d6c64a (diff) | |
download | llvm-bfd41c3f8cc70bd65461a6d767f55c14d72150d9.zip llvm-bfd41c3f8cc70bd65461a6d767f55c14d72150d9.tar.gz llvm-bfd41c3f8cc70bd65461a6d767f55c14d72150d9.tar.bz2 |
[LinkerWrapper][Obvious] Fix missing use of texture data type
Summary:
This was accidentally linked to the wrong pointer, causing unused
variable warnings and registering the wrong thing.
-rw-r--r-- | clang/test/Driver/linker-wrapper-image.c | 4 | ||||
-rw-r--r-- | clang/tools/clang-linker-wrapper/OffloadWrapper.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Driver/linker-wrapper-image.c b/clang/test/Driver/linker-wrapper-image.c index 4a17a83..a2a1996 100644 --- a/clang/test/Driver/linker-wrapper-image.c +++ b/clang/test/Driver/linker-wrapper-image.c @@ -90,7 +90,7 @@ // CUDA-NEXT: %4 = getelementptr inbounds %struct.__tgt_offload_entry, ptr %entry1, i64 0, i32 3 // CUDA-NEXT: %flags = load i32, ptr %4, align 4 // CUDA-NEXT: %5 = getelementptr inbounds %struct.__tgt_offload_entry, ptr %entry1, i64 0, i32 4 -// CUDA-NEXT: %textype = load i32, ptr %4, align 4 +// CUDA-NEXT: %textype = load i32, ptr %5, align 4 // CUDA-NEXT: %type = and i32 %flags, 7 // CUDA-NEXT: %6 = and i32 %flags, 8 // CUDA-NEXT: %extern = lshr i32 %6, 3 @@ -189,7 +189,7 @@ // HIP-NEXT: %4 = getelementptr inbounds %struct.__tgt_offload_entry, ptr %entry1, i64 0, i32 3 // HIP-NEXT: %flags = load i32, ptr %4, align 4 // HIP-NEXT: %5 = getelementptr inbounds %struct.__tgt_offload_entry, ptr %entry1, i64 0, i32 4 -// HIP-NEXT: %textype = load i32, ptr %4, align 4 +// HIP-NEXT: %textype = load i32, ptr %5, align 4 // HIP-NEXT: %type = and i32 %flags, 7 // HIP-NEXT: %6 = and i32 %flags, 8 // HIP-NEXT: %extern = lshr i32 %6, 3 diff --git a/clang/tools/clang-linker-wrapper/OffloadWrapper.cpp b/clang/tools/clang-linker-wrapper/OffloadWrapper.cpp index 58d9e1e..f4f500b 100644 --- a/clang/tools/clang-linker-wrapper/OffloadWrapper.cpp +++ b/clang/tools/clang-linker-wrapper/OffloadWrapper.cpp @@ -385,7 +385,7 @@ Function *createRegisterGlobalsFunction(Module &M, bool IsHIP) { Builder.CreateInBoundsGEP(offloading::getEntryTy(M), Entry, {ConstantInt::get(getSizeTTy(M), 0), ConstantInt::get(Type::getInt32Ty(C), 4)}); - auto *Data = Builder.CreateLoad(Type::getInt32Ty(C), FlagsPtr, "textype"); + auto *Data = Builder.CreateLoad(Type::getInt32Ty(C), DataPtr, "textype"); auto *Kind = Builder.CreateAnd( Flags, ConstantInt::get(Type::getInt32Ty(C), 0x7), "type"); |