Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions clang/include/clang/Basic/AttrDocs.td
Original file line number Diff line number Diff line change
Expand Up @@ -7517,9 +7517,11 @@ the field it is attached to, and it may also lead to emission of automatic fix-i
hints which would help the user replace the use of unsafe functions(/fields) with safe
alternatives, though the attribute can be used even when the fix can't be automated.

* Attribute attached to functions: The attribute does not suppress
``-Wunsafe-buffer-usage`` inside the function to which it is attached.
These warnings still need to be addressed.
* Attribute attached to functions: The attribute suppresses all
``-Wunsafe-buffer-usage`` warnings within the function it is attached to, as the
function is now classified as unsafe. The attribute should be used carefully, as it
will silence all unsafe operation warnings inside the function; including any new
unsafe operations introduced in the future.

The attribute is warranted even if the only way a function can overflow
the buffer is by violating the function's preconditions. For example, it
Expand Down
4 changes: 3 additions & 1 deletion llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,8 +1161,10 @@ void SIFoldOperandsImpl::foldOperand(

if (OpToFold.isImm())
UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm());
else
else if(OpToFold.isFI())
UseMI->getOperand(1).ChangeToFrameIndex(OpToFold.getIndex());
else if(OpToFold.isGlobal())
return;
UseMI->removeOperand(2); // Remove exec read (or src1 for readlane)
return;
}
Expand Down