[PATCH] D99080: Normalize usage of StrBoolAttr

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 08:13:20 PDT 2021


serge-sans-paille created this revision.
serge-sans-paille added a reviewer: nikic.
Herald added subscribers: dexonsmith, jdoerfert, kerbowa, pengfei, hiraditya, nhaehnle, jvesely, arsenm, jholewinski.
serge-sans-paille requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Priori to this patch, StrBoolAttr attributes had the strange property to be either unset, set to false or set to true. And the associated value was a string containing either "true" or "false". This is both cumbersome to use and inefficient.

This patch propose to no longer use the value filed, and just check the presence of the attribute, which was already an established practice in part of the LLVM codebase, see for instance https://reviews.llvm.org/D96400
As a side effect, when compiling sqlite3.c source code in -O0, this change makes the instruction count decrease from  6,157,211,048 to 6,155,407,798. Simpler and faster.


https://reviews.llvm.org/D99080

Files:
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/IR/Attributes.cpp
  llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
  llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
  llvm/lib/Target/ARM/ARMAsmPrinter.cpp
  llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/CodeGen/X86/switch.ll
  llvm/test/Transforms/IROutliner/outlining-compatible-and-attribute-transfer.ll
  llvm/test/Transforms/Inline/attributes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99080.332289.patch
Type: text/x-patch
Size: 23728 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210322/2c1f6e79/attachment.bin>


More information about the llvm-commits mailing list