This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Move SIModeRegisterDefaults to SI MFI
ClosedPublic

Authored by rampitec on Sep 26 2022, 12:42 PM.

Diff Detail

Event Timeline

rampitec created this revision.Sep 26 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 12:42 PM
rampitec requested review of this revision.Sep 26 2022, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 12:42 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm accepted this revision.Sep 26 2022, 12:44 PM
This revision is now accepted and ready to land.Sep 26 2022, 12:44 PM

I think r600 does actually have these options, it's just not wired up

This revision was landed with ongoing or failed builds.Sep 26 2022, 1:20 PM
This revision was automatically updated to reflect the committed changes.
vitalybuka reopened this revision.Sep 26 2022, 10:16 PM
vitalybuka added a subscriber: vitalybuka.

This breaks
https://lab.llvm.org/buildbot/#/builders/5/builds/27754
https://lab.llvm.org/buildbot/#/builders/74/builds/13820

******************** TEST 'LLVM :: CodeGen/AMDGPU/sdivrem24.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/llc -march=amdgcn < /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/test/CodeGen/AMDGPU/sdivrem24.ll | /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck -check-prefix=SI -check-prefix=FUNC /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/test/CodeGen/AMDGPU/sdivrem24.ll
: 'RUN: at line 2';   /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global < /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/test/CodeGen/AMDGPU/sdivrem24.ll | /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck -check-prefix=SI -check-prefix=FUNC /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/test/CodeGen/AMDGPU/sdivrem24.ll
: 'RUN: at line 3';   /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/llc -march=r600 -mcpu=redwood < /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/test/CodeGen/AMDGPU/sdivrem24.ll | /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/FileCheck -check-prefix=EG -check-prefix=FUNC /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/test/CodeGen/AMDGPU/sdivrem24.ll
--
Exit Code: 2

Command Output (stderr):
--
==3187040==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55c8b8ac7870 in llvm::AMDGPUTargetLowering::LowerDIVREM24(llvm::SDValue, llvm::SelectionDAG&, bool) const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1641:20
    #1 0x55c8b8a9e21d in llvm::AMDGPUTargetLowering::LowerSDIVREM(llvm::SDValue, llvm::SelectionDAG&) const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp:1965:23
    #2 0x55c8b91a6d2b in llvm::R600TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp:398:41
    #3 0x55c8c09706e2 in (anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1292:29
    #4 0x55c8c096cb97 in llvm::SelectionDAG::Legalize() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:5098:19
    #5 0x55c8c0db7298 in llvm::SelectionDAGISel::CodeGenAndEmitDAG() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:891:13
    #6 0x55c8c0daec5b in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1598:7
    #7 0x55c8c0da07f4 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:3
    #8 0x55c8bdf8b53e in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:13
    #9 0x55c8bf296ee0 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
    #10 0x55c8bf2b9e36 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
    #11 0x55c8bf299f6b in runOnModule /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
    #12 0x55c8bf299f6b in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
    #13 0x55c8b7bc2cd9 in compileModule(char**, llvm::LLVMContext&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/tools/llc/llc.cpp:734:8
    #14 0x55c8b7bba3f2 in main /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/tools/llc/llc.cpp:418:22
    #15 0x7f9534cabd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
    #16 0x7f9534cabe3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
    #17 0x55c8b7b250b4 in _start (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan_track_origins/bin/llc+0x397d0b4)

  Memory was marked as uninitialized
    #0 0x55c8b7b5a4bd in __msan_allocated_memory /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:928:5
    #1 0x55c8b813a598 in llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>::Allocate(unsigned long, llvm::Align) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:170:7
    #2 0x55c8b91a5ddb in Allocate /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/Allocator.h:209:12
    #3 0x55c8b91a5ddb in Allocate /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/AllocatorBase.h:47:43
    #4 0x55c8b91a5ddb in Allocate<llvm::R600MachineFunctionInfo> /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/Support/AllocatorBase.h:70:29
    #5 0x55c8b91a5ddb in create<llvm::R600MachineFunctionInfo> /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/CodeGen/MachineFunction.h:104:27
    #6 0x55c8b91a5ddb in getInfo<llvm::R600MachineFunctionInfo> /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/CodeGen/MachineFunction.h:756:16
    #7 0x55c8b91a5ddb in llvm::R600TargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/Target/AMDGPU/R600ISelLowering.cpp:396:37
    #8 0x55c8c0bdc1df in llvm::TargetLowering::LowerOperationWrapper(llvm::SDNode*, llvm::SmallVectorImpl<llvm::SDValue>&, llvm::SelectionDAG&) const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:10094:17
    #9 0x55c8c0e13d7c in llvm::DAGTypeLegalizer::CustomLowerNode(llvm::SDNode*, llvm::EVT, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
    #10 0x55c8c0e75822 in llvm::DAGTypeLegalizer::PromoteIntegerOperand(llvm::SDNode*, unsigned int) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:1614:7
    #11 0x55c8c0e001fa in llvm::DAGTypeLegalizer::run() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:326:28
    #12 0x55c8c0e1a198 in llvm::SelectionDAG::LegalizeTypes() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1060:34
    #13 0x55c8c0db4e30 in llvm::SelectionDAGISel::CodeGenAndEmitDAG() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:793:23
    #14 0x55c8c0daec5b in llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1598:7
    #15 0x55c8c0da07f4 in llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:467:3
    #16 0x55c8bdf8b53e in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:91:13
    #17 0x55c8bf296ee0 in llvm::FPPassManager::runOnFunction(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1430:27
    #18 0x55c8bf2b9e36 in llvm::FPPassManager::runOnModule(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1476:16
    #19 0x55c8bf299f6b in runOnModule /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1545:27
    #20 0x55c8bf299f6b in llvm::legacy::PassManagerImpl::run(llvm::Module&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:535:44
    #21 0x55c8b7bc2cd9 in compileModule(char**, llvm::LLVMContext&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/tools/llc/llc.cpp:734:8
    #22 0x55c8b7bba3f2 in main /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/tools/llc/llc.cpp:418:22
    #23 0x7f9534cabd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
This revision is now accepted and ready to land.Sep 26 2022, 10:16 PM
rampitec updated this revision to Diff 463247.Sep 27 2022, 8:48 AM

Fixed msan failure. Turns out I should not request SI MFI and check if it is null.

rampitec requested review of this revision.Sep 27 2022, 8:48 AM
arsenm added inline comments.Sep 27 2022, 12:18 PM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1635–1638

This shows it is used by shared code, what's the point?

rampitec added inline comments.Sep 27 2022, 12:24 PM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1635–1638

R600 indeed uses the same lowering for mul24 and calls this function.

rampitec added inline comments.Sep 27 2022, 12:50 PM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1635–1638

It's just R600 always flush as far as I understand.

arsenm accepted this revision.Sep 28 2022, 12:43 PM
This revision is now accepted and ready to land.Sep 28 2022, 12:43 PM
This revision was landed with ongoing or failed builds.Sep 28 2022, 1:13 PM
This revision was automatically updated to reflect the committed changes.