llvm.org GIT mirror llvm / 719f93d
[EarlyCSE] Add support for unary FNeg to EarlyCSE Differential Revision: https://reviews.llvm.org/D65815 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368171 91177308-0d34-0410-b5e6-96231b3b80d8 Cameron McInally a month ago
2 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
107107 // This can only handle non-void readnone functions.
108108 if (CallInst *CI = dyn_cast(Inst))
109109 return CI->doesNotAccessMemory() && !CI->getType()->isVoidTy();
110 return isa(Inst) || isa(Inst) ||
111 isa(Inst) || isa(Inst) ||
112 isa(Inst) || isa(Inst) ||
113 isa(Inst) || isa(Inst) ||
114 isa(Inst) || isa(Inst);
110 return isa(Inst) || isa(Inst) ||
111 isa(Inst) || isa(Inst) ||
112 isa(Inst) || isa(Inst) ||
113 isa(Inst) || isa(Inst) ||
114 isa(Inst) || isa(Inst) ||
115 isa(Inst);
115116 }
116117 };
117118
239240
240241 assert((isa(Inst) || isa(Inst) ||
241242 isa(Inst) || isa(Inst) ||
242 isa(Inst)) &&
243 isa(Inst) || isa(Inst)) &&
243244 "Invalid/unknown instruction");
244245
245246 // Mix in the opcode.
1616 ; CSE unary fnegs.
1717 define void @fX(<4 x float> *%p, <4 x float> %a) {
1818 ; CHECK: %x = fneg <4 x float> %a
19 ; CHECK: %y = fneg <4 x float> %a
20 ; CHECK-NEXT: store volatile <4 x float> %x, <4 x float>* %p
21 ; CHECK-NEXT: store volatile <4 x float> %y, <4 x float>* %p
19 ; CHECK-NEXT: store volatile <4 x float> %x, <4 x float>* %p
20 ; CHECK-NEXT: store volatile <4 x float> %x, <4 x float>* %p
2221 %x = fneg <4 x float> %a
2322 %y = fneg <4 x float> %a
2423 store volatile <4 x float> %x, <4 x float>* %p