[PATCH] D59990: AMDGPU. Divergence driven ISel. Assign register class for cross block values according to the divergence.
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 15 08:15:18 PDT 2019
rampitec added inline comments.
================
Comment at: include/llvm/CodeGen/FunctionLoweringInfo.h:246
+
+ unsigned CreateRegs(const Value * V);
----------------
Formatting.
================
Comment at: include/llvm/CodeGen/FunctionLoweringInfo.h:248
- unsigned CreateRegs(Type *Ty);
+ unsigned CreateRegs(Type * Ty, bool isDivergent = false);
----------------
Formatting.
================
Comment at: lib/CodeGen/SelectionDAG/InstrEmitter.cpp:294
const TargetRegisterClass *RC =
- TLI->getRegClassFor(Op.getSimpleValueType());
+ TLI->getRegClassFor(Op.getSimpleValueType(),
+ Op.getNode()->isDivergent());
----------------
Formatting.
================
Comment at: lib/CodeGen/SelectionDAG/InstrEmitter.cpp:593
+ const TargetRegisterClass *SRC = TLI->getRegClassFor(Node->getSimpleValueType(0),
+ Node->isDivergent());
SRC = TRI->getSubClassWithSubReg(SRC, SubIdx);
----------------
Formatting.
================
Comment at: lib/Target/AMDGPU/SIFixSGPRCopies.cpp:635
+ unsigned Reg = UseMI->getOperand(0).getReg();
+ if (TRI->isPhysicalRegister(Reg)) {
+ if (!TRI->isSGPRReg(MRI, Reg)) {
----------------
rampitec wrote:
> I think you can decrease nesting here. At the very least join individual "if" conditions with "&&".
You can still decrease nesting.
================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:9638
MVT VT = Src0.getValueType().getSimpleVT();
- const TargetRegisterClass *RC = getRegClassFor(VT);
+ const TargetRegisterClass *RC = getRegClassFor(VT,
+ Src0.getNode()->isDivergent());
----------------
Formatting.
================
Comment at: lib/Target/AMDGPU/SIISelLowering.h:370
AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *) const override;
-
+ virtual const TargetRegisterClass *getRegClassFor(MVT VT,
+ bool isDivergent) const override;
----------------
Formatting.
================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:1432
/// specified value type.
-const TargetRegisterClass *ARMTargetLowering::getRegClassFor(MVT VT) const {
+const TargetRegisterClass *ARMTargetLowering::getRegClassFor(MVT VT,
+ bool isDivergent) const {
----------------
Formatting.
================
Comment at: lib/Target/ARM/ARMISelLowering.h:459
/// specified value type.
- const TargetRegisterClass *getRegClassFor(MVT VT) const override;
+ const TargetRegisterClass *getRegClassFor(MVT VT,
+ bool isDivergent=false) const override;
----------------
Formatting.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59990/new/
https://reviews.llvm.org/D59990
More information about the llvm-commits
mailing list