[Attributes] Avoid duplicate hasAttribute() query (NFC)
authorNikita Popov <npopov@redhat.com>
Mon, 9 Jan 2023 11:55:47 +0000 (12:55 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 9 Jan 2023 11:59:16 +0000 (12:59 +0100)
commit9afb6360fcbb5c94f37f6c1328bfa76ca8e20021
tree01aade15041ff80caa5b7886b59ef9facab2b779
parent07d6af6a71001c3d3a7aae21085646e642fbb56c
[Attributes] Avoid duplicate hasAttribute() query (NFC)

removeAttribute() already performs a hasAttribute() check, so no
need to also do it in the caller. Instead check whether the
attribute set was changed.

This makes the implementations in line with removeAttributesAtIndex().
llvm/lib/IR/Attributes.cpp