[PATCH] D103787: [RISCV] Don't enable loop vectorizer interleaving if the V extension isn't enabled.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 6 23:33:46 PDT 2021
craig.topper created this revision.
craig.topper added reviewers: frasercrmck, luke957.
Herald added subscribers: vkmr, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.
This can cause the vectorizer to generate interleaved scalar
code which might be ok for some CPUs, but definitely not all.
Disable it to restore the previous scalar behavior.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D103787
Files:
llvm/lib/Target/RISCV/RISCVSubtarget.h
Index: llvm/lib/Target/RISCV/RISCVSubtarget.h
===================================================================
--- llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -135,7 +135,9 @@
assert(i < RISCV::NUM_TARGET_REGS && "Register out of range");
return UserReservedRegister[i];
}
- unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }
+ unsigned getMaxInterleaveFactor() const {
+ return hasStdExtV() ? MaxInterleaveFactor : 1;
+ }
protected:
// GlobalISel related APIs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103787.350179.patch
Type: text/x-patch
Size: 552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210607/39686abc/attachment.bin>
More information about the llvm-commits
mailing list