Hopefully straightforward, what do you think?
I was mostly annoyed by the awkwardness of building a splat, but figured I might as well add getBuildVector.
I thought I'd wait for opinions before finishing to change the remaining calls.
| Paths 
 |  Differential  D17176  
[CodeGen] Add getBuildVector and getSplatBuildVector helpers. ClosedPublic Authored by ab on Feb 11 2016, 4:28 PM. 
Details Summary Hopefully straightforward, what do you think? I was mostly annoyed by the awkwardness of building a splat, but figured I might as well add getBuildVector. I thought I'd wait for opinions before finishing to change the remaining calls. 
Diff Detail 
 Event Timelineab updated this object. Comment Actions Very useful! 
 Comment Actions I didn't look closely enough to know if this would help here, but it could shave a couple of lines off of the current D17181 patch: DAG.getConstant() has the unadvertised feature (no documentation or implementation comments) of creating splat build vector constants. I used it here (hopefully without introducing any bugs!): Comment Actions 
 Interesting, I didn't know! Let me add a comment and use that instead. I do think that the name "getConstant" could be confusing. In practice I don't think it's a problem, with proper names and context. That's not ideal though, so perhaps we should add "getConstantVec" (or "getConstantSplat"?) versions of the 6 getConstant variants we already have? 
 Comment Actions Hi Ahmed, do you still intend to work on this? I still think this would be useful - especially as BUILD_VECTOR with different sized operands don't assert until much later without it. Comment Actions 
 Yes, sorry, I've been busy with non-llvm things; I'll try to get back to this in the next few days! ab edited edge metadata.Comment Actions 
 ab added inline comments. 
 
 ab added inline comments. 
 
 RKSimon edited edge metadata.Comment Actions LGTM - in hindsight the getSplatBuildVector looks like the more useful one of the two, but getBuildVector does at least reduce the code text a little to allow clang-format to tidy things up a bit ;-) This revision is now accepted and ready to land.Apr 26 2016, 10:54 AM Closed by commit rL267606: [CodeGen] Add getBuildVector and getSplatBuildVector helpers. NFCI. (authored by ab).  ·  Explain WhyApr 26 2016, 2:21 PM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 55090 llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
 llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
 
 llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
 
 llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
 
 llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
 llvm/trunk/lib/Target/AMDGPU/R600ISelLowering.cpp
 llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
 llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
 
 llvm/trunk/lib/Target/Mips/MipsSEISelLowering.cpp
 llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
 llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
 
 llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
 llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
 
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||