This is an archive of the discontinued LLVM Phabricator instance.

[SVE][CodeGen] Fix up warnings in sve-split-insert/extract tests
ClosedPublic

Authored by david-arm on Aug 24 2020, 12:52 AM.

Details

Summary

I have fixed up some more ElementCount/TypeSize related warnings in
the following tests:

CodeGen/AArch64/sve-split-extract-elt.ll
CodeGen/AArch64/sve-split-insert-elt.ll

In SelectionDAG::CreateStackTemporary we were relying upon the implicit
cast from TypeSize -> uint64_t when calling MachineFrameInfo::CreateStackObject.
I've fixed this by passing in the known minimum size instead, which I
believe is fine because the associated stack id indicates whether this
is a scalable object or not.

I've also fixed up a case in TargetLowering::SimplifyDemandedBits when
extracting a vector element from a scalable vector. The result is a scalar,
hence it wasn't caught at the start of the function. If the vector is
scalable we just bail out for now.

Diff Detail

Event Timeline

david-arm created this revision.Aug 24 2020, 12:52 AM
Herald added a project: Restricted Project. · View Herald Transcript
david-arm requested review of this revision.Aug 24 2020, 12:52 AM
This revision is now accepted and ready to land.Sep 2 2020, 3:49 AM
efriedma added inline comments.Sep 2 2020, 5:07 PM
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
2041

Please bail out here for scalable vectors even if KnownIdx is in range. The rest of the demanded bits code code doesn't expect scalable vectors at the moment.

david-arm updated this revision to Diff 289727.Sep 3 2020, 8:30 AM
david-arm edited the summary of this revision. (Show Details)
  • Changed the SimplifyDemandedBits code to simply bail out if it's a scalable vector we're extracting from.
david-arm marked an inline comment as done.Sep 3 2020, 8:30 AM
efriedma accepted this revision.Sep 3 2020, 12:31 PM

LGTM with one minor comment

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
2032

getFixedValue().

fhahn added a subscriber: fhahn.Jan 5 2021, 1:37 AM
fhahn added inline comments.
llvm/include/llvm/Support/TypeSize.h
119

Does this comment intentionally not use ///? As is the documentation is missing in the rendered docs (https://llvm.org/docs/doxygen/classllvm_1_1LinearPolySize.html#a46d9c84b6f3a39f74ab8d5906c4fcf61)

david-arm marked an inline comment as done.Jan 5 2021, 1:40 AM
david-arm added inline comments.
llvm/include/llvm/Support/TypeSize.h
119

No it's not intentional. I just forget to use the doxygen format sometimes. I can fix this.

fhahn added inline comments.Jan 5 2021, 2:33 AM
llvm/include/llvm/Support/TypeSize.h
119

that would be great, thanks!