[llvm-commits] [llvm] r170246 - /llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Sat Dec 15 10:00:08 PST 2012
I re-enabled vectorize locally with a few tweaks in SROA.
On x86-64, dozen of differences can be seen between stage2 and stage3.
http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/300
On i686, stage2 clang still miscompiles...
http://bb.pgr.jp/builders/clang-3stage-cygwin/builds/138
FYI, I tweaked as below;
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -1763,6 +1763,8 @@ static Value
*getNaturalGEPRecursively(IRBuilder<> &IRB, const DataLayout &TD,
// over a vector from the IR completely.
if (VectorType *VecTy = dyn_cast<VectorType>(Ty)) {
unsigned ElementSizeInBits = VecTy->getScalarSizeInBits();
+ if (ElementSizeInBits == 0)
+ return 0;
if (ElementSizeInBits % 8)
return 0; // GEPs over non-multiple of 8 size vector elements
are invalid.
APInt ElementSize(Offset.getBitWidth(), ElementSizeInBits / 8);
@@ -2012,6 +2014,9 @@ static bool isVectorPromotionViable(const DataLayout &TD,
uint64_t VecSize = TD.getTypeSizeInBits(Ty);
uint64_t ElementSize = Ty->getScalarSizeInBits();
+ if (ElementSize == 0)
+ return false;
+
// While the definition of LLVM vectors is bitpacked, we don't support sizes
// that aren't byte sized.
if (ElementSize % 8)
---
...Takumi
2012/12/15 NAKAMURA Takumi <geek4civic at gmail.com>:
> Nadav, I have reverted it again.
>
> On x86-64, stage1 clang (generated by host g++) crashes to compile
> ADT/VariadicFunctionTest.cpp.
> http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/292
>
> On i686, stage2 clang miscompiles bunch of files.
> http://bb.pgr.jp/builders/clang-3stage-cygwin/builds/133
>
> I'll investigate too, (if I had a time).
>
> ...Takumi
>
> 2012/12/15 Nadav Rotem <nrotem at apple.com>:
>> Author: nadav
>> Date: Fri Dec 14 15:30:23 2012
>> New Revision: 170246
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=170246&view=rev
>> Log:
>> Enable the loop vectorizer by default.
>>
>> Modified:
>> llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
>>
>> Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=170246&r1=170245&r2=170246&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
>> +++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Fri Dec 14 15:30:23 2012
>> @@ -188,7 +188,7 @@
>> MPM.add(createLoopIdiomPass()); // Recognize idioms like memset.
>> MPM.add(createLoopDeletionPass()); // Delete dead loops
>>
>> - if (LoopVectorize && OptLevel > 1)
>> + if (true && OptLevel > 1)
>> MPM.add(createLoopVectorizePass());
>>
>> if (!DisableUnrollLoops)
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list