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

            Bug ID: 37756
           Summary: `mayReadOrWriteMemory` method behaviour in
                    `Instruction` class
           Product: new-bugs
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Hello,

In the comment to `mayReadOrWriteMemory` method [1] said that it resurns "true
if this instruction may read or write memory".

Unfortunatelly, if we check both `mayWriteToMemory` and `mayReadFromMemory`
methods [2, 3], they do not check opcode Alloca.
But in language reference said that "the `alloca` instruction allocates
sizeof(<type>)*NumElements bytes of memory on the runtime stack" [4]. Thus, it
is possible to say in other words, that `alloca` instruction modifies memory,
as said in the comment to `mayWriteToMemory` method, and I think this should be
checked in that method.

Or do I understand incorrectly the logic behind `mayReadOrWriteMemory` method?

Thank you,
Petr.

[1]
https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Instruction.h#L496L498
[2]
https://github.com/llvm-mirror/llvm/blob/master/lib/IR/Instruction.cpp#L523L541
[3]
https://github.com/llvm-mirror/llvm/blob/master/lib/IR/Instruction.cpp#L503L521
[4] https://llvm.org/docs/LangRef.html#alloca-instruction

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to