// This can only handle non-void readnone functions.
if (CallInst *CI = dyn_cast<CallInst>(Inst))
return CI->doesNotAccessMemory() && !CI->getType()->isVoidTy();
- return isa<CastInst>(Inst) || isa<BinaryOperator>(Inst) ||
- isa<GetElementPtrInst>(Inst) || isa<CmpInst>(Inst) ||
- isa<SelectInst>(Inst) || isa<ExtractElementInst>(Inst) ||
- isa<InsertElementInst>(Inst) || isa<ShuffleVectorInst>(Inst) ||
- isa<ExtractValueInst>(Inst) || isa<InsertValueInst>(Inst);
+ return isa<CastInst>(Inst) || isa<UnaryOperator>(Inst) ||
+ isa<BinaryOperator>(Inst) || isa<GetElementPtrInst>(Inst) ||
+ isa<CmpInst>(Inst) || isa<SelectInst>(Inst) ||
+ isa<ExtractElementInst>(Inst) || isa<InsertElementInst>(Inst) ||
+ isa<ShuffleVectorInst>(Inst) || isa<ExtractValueInst>(Inst) ||
+ isa<InsertValueInst>(Inst);
}
};
assert((isa<CallInst>(Inst) || isa<GetElementPtrInst>(Inst) ||
isa<ExtractElementInst>(Inst) || isa<InsertElementInst>(Inst) ||
- isa<ShuffleVectorInst>(Inst)) &&
+ isa<ShuffleVectorInst>(Inst) || isa<UnaryOperator>(Inst)) &&
"Invalid/unknown instruction");
// Mix in the opcode.
; CSE unary fnegs.
define void @fX(<4 x float> *%p, <4 x float> %a) {
; CHECK: %x = fneg <4 x float> %a
- ; CHECK: %y = fneg <4 x float> %a
- ; CHECK-NEXT: store volatile <4 x float> %x, <4 x float>* %p
- ; CHECK-NEXT: store volatile <4 x float> %y, <4 x float>* %p
+ ; CHECK-NEXT: store volatile <4 x float> %x, <4 x float>* %p
+ ; CHECK-NEXT: store volatile <4 x float> %x, <4 x float>* %p
%x = fneg <4 x float> %a
%y = fneg <4 x float> %a
store volatile <4 x float> %x, <4 x float>* %p