[PATCH] D35498: [LoopVectorizer] Use two step casting for float to pointer type.
Renato Golin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 08:38:19 PDT 2017
rengolin added inline comments.
================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:579
+ /// Also handles bitcasts of float <--> pointer types.
+ Value* createBitCast(Value *V, VectorType* DstVTy, const DataLayout& DL);
+
----------------
NIT: I think you should keep the `createBitOrPointerCast` name, to make it clear.
================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:3318
+ // vector<int> and vector<ptr> types and may fail. So try another time
+ // but using element types.
+ if (CastInst::isBitOrNoopPointerCastable(SrcElemTy, DstElemTy, DL)) {
----------------
Could you just keep this version?
Most of the code above will be nops anyway, no need to fast-track identical calls.
================
Comment at: test/CodeGen/ARM/loopvectorize_pr33804_1.ll:18
+; CHECK: store <8 x %struct.CvNode1D*>
+define void @cvCalcEMD2() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+entry:
----------------
Do you really need all the exception handling here? I imagine that the loop below would do just fine.
================
Comment at: test/CodeGen/ARM/loopvectorize_pr33804_2.ll:18
+; CHECK: store <8 x float>
+define void @cvCalcEMD2() local_unnamed_addr #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+entry:
----------------
Same here. Also, you could merge the two function into one single IR file.
https://reviews.llvm.org/D35498
More information about the llvm-commits
mailing list