[llvm] 18d7e82 - [OpaquePtr] Enumerate alloca type

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 25 01:49:58 PDT 2021


Author: Nikita Popov
Date: 2021-06-25T10:48:57+02:00
New Revision: 18d7e822ab22e6747f01b0409ace5044733be162

URL: https://github.com/llvm/llvm-project/commit/18d7e822ab22e6747f01b0409ace5044733be162
DIFF: https://github.com/llvm/llvm-project/commit/18d7e822ab22e6747f01b0409ace5044733be162.diff

LOG: [OpaquePtr] Enumerate alloca type

This is no longer implicitly enumerated through the pointer type.

Added: 
    

Modified: 
    llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
    llvm/test/Other/force-opaque-ptrs.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index 7baed6c8feed..c347c401a5b9 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -469,6 +469,8 @@ ValueEnumerator::ValueEnumerator(const Module &M,
           EnumerateType(SVI->getShuffleMaskForBitcode()->getType());
         if (auto *GEP = dyn_cast<GetElementPtrInst>(&I))
           EnumerateType(GEP->getSourceElementType());
+        if (auto *AI = dyn_cast<AllocaInst>(&I))
+          EnumerateType(AI->getAllocatedType());
         EnumerateType(I.getType());
         if (const auto *Call = dyn_cast<CallBase>(&I)) {
           EnumerateAttributes(Call->getAttributes());

diff  --git a/llvm/test/Other/force-opaque-ptrs.ll b/llvm/test/Other/force-opaque-ptrs.ll
index 486af5a379bd..f8d5b8e06539 100644
--- a/llvm/test/Other/force-opaque-ptrs.ll
+++ b/llvm/test/Other/force-opaque-ptrs.ll
@@ -8,7 +8,9 @@
 
 define void @f(i32* %p) {
 ; CHECK-LABEL: @f(
+; CHECK-NEXT:    [[A:%.*]] = alloca i17, align 4
 ; CHECK-NEXT:    ret void
 ;
+  %a = alloca i17
   ret void
 }


        


More information about the llvm-commits mailing list