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: unassignedb...@nondot.org
          Reporter: jack....@intel.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to