[LLVMbugs] [Bug 8994] New: Constant prop fails on vector code
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Jan 17 05:14:29 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=8994
Summary: Constant prop fails on vector code
Product: libraries
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
AssignedTo: unassignedbugs at nondot.org
ReportedBy: boaz.ouriel at intel.com
CC: llvmbugs at cs.uiuc.edu
The instruction combine pass carshes when trying to fold a bitcast from a
vector type to a scalar type. Reproduce with:
define i48 @test(<3 x i1> %icmp1, <3 x i1> %icmp2, i16 addrspace(1)* %dst)
nounwind {
entry:
%select1 = select <3 x i1> %icmp1, <3 x i16> zeroinitializer, <3 x i16> <i16
-1, i16 -1, i16 -1>
%select2 = select <3 x i1> %icmp2, <3 x i16> zeroinitializer, <3 x i16>
%select1
%tmp2 = bitcast <3 x i16> %select2 to i48
ret i48 %tmp2
}
here's a fix:
Index: InstructionCombining.cpp
===================================================================
--- InstructionCombining.cpp (revision xxx)
+++ InstructionCombining.cpp (revision xxx)
@@ -221,6 +221,12 @@
Instruction *InstCombiner::FoldOpIntoSelect(Instruction &Op, SelectInst *SI) {
// Don't modify shared select instructions
if (!SI->hasOneUse()) return 0;
+
+ // we cannot fold bitcasts which transform a vector to scalars
+ if ( BitCastInst* BI = dyn_cast<BitCastInst>(&Op) ) {
+ if ( BI->getSrcTy()->isVectorTy() ) return 0;
+ }
+
Value *TV = SI->getOperand(1);
Value *FV = SI->getOperand(2);
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list