[llvm-bugs] [Bug 44501] New: bblockaddress does not work correctly with program address spaces
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Thu Jan  9 08:33:10 PST 2020
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=44501
            Bug ID: 44501
           Summary: bblockaddress does not work correctly with program
                    address spaces
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: Matthew.Arsenault at amd.com
                CC: arichardson.kde at gmail.com, llvm-bugs at lists.llvm.org
This program should fail the verifier, as the blockaddress pointer type does
not match the function's address space.
target datalayout = "e-p:64:64-p1:32:32-P1"
define i32 @label_size(i64 %idx) addrspace(1) {
entry:
  %int = ptrtoint i8* blockaddress(@label_size, %bb) to i32
  br label %bb
bb:
  ret i32 %int
}
If you do use the correct pointer type, the parser fails on it:
define i32 @label_size(i64 %idx) addrspace(1) {
entry:
  %int = ptrtoint i8 addrspace(1)* blockaddress(@label_size, %bb) to i32
  br label %bb
bb:
  ret i32 %int
}
gives "error: constant expression type mismatch"
Additionally, DataLayout::getTypeSizeInBits does not account for the program
address space when checking for the size of labels.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200109/115199f6/attachment.html>
    
    
More information about the llvm-bugs
mailing list