llvm-project/llvm/lib/Transforms/InstCombine
Reid Kleckner a0b45f4bfc [IR] Abstract away ArgNo+1 attribute indexing as much as possible
Summary:
Do three things to help with that:
- Add AttributeList::FirstArgIndex, which is an enumerator currently set
  to 1. It allows us to change the indexing scheme with fewer changes.
- Add addParamAttr/removeParamAttr. This just shortens addAttribute call
  sites that would otherwise need to spell out FirstArgIndex.
- Remove some attribute-specific getters and setters from Function that
  take attribute list indices.  Most of these were only used from
  BuildLibCalls, and doesNotAlias was only used to test or set if the
  return value is malloc-like.

I'm happy to split the patch, but I think they are probably easier to
review when taken together.

This patch should be NFC, but it sets the stage to change the indexing
scheme to this, which is more convenient when indexing into an array:
  0: func attrs
  1: retattrs
  2...: arg attrs

Reviewers: chandlerc, pete, javed.absar

Subscribers: david2050, llvm-commits

Differential Revision: https://reviews.llvm.org/D32811

llvm-svn: 302060
2017-05-03 18:17:31 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [APInt] Add clearSignBit method. Use it and setSignBit in a few places. NFCI 2017-04-28 16:58:05 +00:00
InstCombineAndOrXor.cpp [InstCombine] don't use DeMorgan's Law on integer constants (2nd try) 2017-05-02 15:31:40 +00:00
InstCombineCalls.cpp [IR] Abstract away ArgNo+1 attribute indexing as much as possible 2017-05-03 18:17:31 +00:00
InstCombineCasts.cpp [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits 2017-04-26 16:39:58 +00:00
InstCombineCompares.cpp [APInt] Add clearSignBit method. Use it and setSignBit in a few places. NFCI 2017-04-28 16:58:05 +00:00
InstCombineInternal.h InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineLoadStoreAlloca.cpp [InstCombine] Reduce visitLoadInst() code duplication. NFCI. 2017-04-19 17:26:57 +00:00
InstCombineMulDivRem.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombinePHI.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineSelect.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineShifts.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstCombineSimplifyDemanded.cpp [KnownBits] Add methods for determining if the known bits represent a negative/nonnegative number and add methods for changing the negative/nonnegative state 2017-04-29 16:43:11 +00:00
InstCombineVectorOps.cpp InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. 2017-04-26 20:56:07 +00:00
InstructionCombining.cpp Rename WeakVH to WeakTrackingVH; NFC 2017-05-01 17:07:49 +00:00
LLVMBuild.txt