-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 9011 |
| Resolution | FIXED |
| Resolved on | Jan 20, 2011 19:58 |
| Version | trunk |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
There is missing constant folding of casting operation for vector of 0's.
Probably it is due to fact that vector of zeroes is described by ConstantAggregateZero and its handling is missing from ConstantFolding.
As result some of the shaders when running with 'opt -std-compile-opts' may run infinitely long time. See attached .ll for example.
To reproduce the bug just run attached .ll with 'opt -std-compile-opts'
The fix is inlined (due to its simplicity)
Index: lib/VMCore/ConstantFold.cpp
--- lib/VMCore/ConstantFold.cpp (revision 2460)
+++ lib/VMCore/ConstantFold.cpp (working copy)
@@ -553,6 +553,9 @@
return ConstantVector::get(DestVecTy, res);
}
- if (ConstantAggregateZero *CZ = dyn_cast(V)) {
-
return Constant::getNullValue(DestTy); - }
// We actually have to do a cast now. Perform the cast according to the
// opcode specified.
switch (opc) {