[PATCH] D86159: [GlobalISel][CallLowering] NFC: Unify flag-setting from CallBase + AttributeList

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 10:50:48 PDT 2020


paquette created this revision.
paquette added reviewers: aemerson, arsenm.
Herald added subscribers: hiraditya, rovka.
Herald added a project: LLVM.
paquette requested review of this revision.
Herald added a subscriber: wdng.

It's annoying to have to maintain multiple, nearly identical chains of if statements which all set the same attributes.

Add a helper function, `addFlagsUsingAttrFn` which performs the attribute setting.

Then, use wrappers for that function in `lowerCall` and `setArgFlags`.

(Note that the flag-setting code in `setArgFlags` was missing the returned attribute. There's no selection for this yet, so no test. It's an example of the kind of thing this lets us avoid, though.)


https://reviews.llvm.org/D86159

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
  llvm/lib/CodeGen/GlobalISel/CallLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86159.286350.patch
Type: text/x-patch
Size: 5019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200818/c8295807/attachment.bin>


More information about the llvm-commits mailing list