[llvm-bugs] [Bug 27520] New: on handling Instruction::AddrSpaceCast in stripPointerCastsAndOffsets() at Value.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 25 15:10:10 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27520

            Bug ID: 27520
           Summary: on handling Instruction::AddrSpaceCast in
                    stripPointerCastsAndOffsets() at Value.cpp
           Product: new-bugs
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jack.liu at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Function stripPointerCastsAndOffsets() at Value.cpp will handle the
AddrSpaceCast case as follows:

   static Value *stripPointerCastsAndOffsets(Value *V) {
     ...
     } else if (Operator::getOpcode(V) == Instruction::BitCast ||
               Operator::getOpcode(V) == Instruction::AddrSpaceCast) {
       V = cast<Operator>(V)->getOperand(0);
     } else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
       ...

This does not look correct, since according to LLVM langref, "The
‘addrspacecast‘ instruction converts the pointer value ptrval to type pty2. It
can be a no-op cast or a complex value modification, depending on the target
and the address space pair."

Should we remove the check of Instruction::AddrSpaceCast here?

-- 
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/20160425/efef12e6/attachment.html>


More information about the llvm-bugs mailing list