Check iterator validity before use; fixes a crash seen in RISCVFrameLowering
when executing the Prologue/Epilogue Insertion & Frame Finalization pass.
Note: -mattr=+zcmp is essential to the reproducibility of the issue.
Details
Diff Detail
Unit Tests
Time | Test | |
---|---|---|
60,040 ms | x64 debian > MLIR.Examples/standalone::test.toy |
Event Timeline
Oh, Vow, thank you! Yes, the change to llvm/lib/Target/RISCV/RISCVFrameLowering.cpp is identical indeed.
The test case, is derived using bugpoint, on an internal benchmark.
Can we merge these two patches into one? You can add tests in this patch to D158256 and close this one.
Addressed review comments to llvm/test/CodeGen/RISCV/zcmp-prolog-epilog-crash.ll from D158256:
craig.topper:
Do we need the hidden and local_unnamed_addr attributes?
DONE
icmp slt i32 poison, poison doesn't make sense. The compiler would be allowed to delete it. So a future optimization could break this test.
DONE
store i32 0, ptr null, align 4 is a store to null which is undefined behavior. So the compiler is allowed to delete it. Again a future optimization could delete it and break this test.
DONE
jrtc27:
Use update_llc_test_checks.py
DONE
Though why is there an IR test and a MIR test? The MIR test seems preferable, surely?
Please feel free to drop: llvm/test/CodeGen/RISCV/zcmp-prolog-epilog-crash.ll
Though it looks like the same code is generated for both so can share one prefix?
Actually, there is a difference ...
nounwind
DONE
Space between declaration and definition
DONE
Clean up the IR of these comments?
DONE
Dangling attribute reference
DONE
This seems overly-reduced
Asked for clarification ...
Fix // No newline at end of file
DONE?
@garvitgupta08 respun post minor cleanup. Please use this latest version. Earlier checklist holds. Thanks!