diff options
author | Amara Emerson <aemerson@apple.com> | 2019-04-15 22:34:08 +0000 |
---|---|---|
committer | Amara Emerson <aemerson@apple.com> | 2019-04-15 22:34:08 +0000 |
commit | 02a90ea73de5f11a476787b66246eb1f39fa9e4a (patch) | |
tree | 56e573ea5d76a0aedea84683be9fa8f3916461e5 /llvm/lib | |
parent | fda04268886028c0b0b7fd9546548714e4209d5e (diff) | |
download | bcm5719-llvm-02a90ea73de5f11a476787b66246eb1f39fa9e4a.tar.gz bcm5719-llvm-02a90ea73de5f11a476787b66246eb1f39fa9e4a.zip |
[AArch64][GlobalISel] Don't do extending loads combine for non-pow-2 types.
Since non-pow-2 types are going to get split up into multiple loads anyway,
don't do the [SZ]EXTLOAD combine for those and save us trouble later in
legalization.
llvm-svn: 358458
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 2eab5748980..4a4431643b0 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -194,6 +194,11 @@ bool CombinerHelper::matchCombineExtendingLoads(MachineInstr &MI, if (LoadValueTy.getSizeInBits() < 8) return false; + // For non power-of-2 types, they will very likely be legalized into multiple + // loads. Don't bother trying to match them into extending loads. + if (!isPowerOf2_32(LoadValueTy.getSizeInBits())) + return false; + // Find the preferred type aside from the any-extends (unless it's the only // one) and non-extending ops. We'll emit an extending load to that type and // and emit a variant of (extend (trunc X)) for the others according to the |