My earlier patch failed to check null ptr before dyn_cast.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | ||
---|---|---|
831 | You might consider using dyn_cast_or_null(), so you can reduce indent and fold the null checks into the inner if condition. | |
test/CodeGen/AArch64/gep-nullptr.ll | ||
7 | Can you please simplify some of the names, so this is more human readable? | |
30 | Please drop the attribute/metadata if it's not relevant to reproducing the issue. |
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | ||
---|---|---|
829 | I believe you still need to add the nullptr checks for FirstGEP and SecondGEP. |
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | ||
---|---|---|
829 | Thanks, Chad: That's not needed because I checked in isLegalToSwapOperand(). |
Can you please cleanup the test case to be more human readable?
Is the test just verifying that we don't get a compiler ICE due to dereferencing a nullptr? If so, please add a comment to the test case expressing this.
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp | ||
---|---|---|
829 | Okay, that's fine. | |
test/CodeGen/AArch64/gep-nullptr.ll | ||
11 | Is the lifetime intrinsic relevant to the test? | |
18 | You should probably use a CHECK-LABEL directive like ; CHECK-LABEL: test |
test/CodeGen/AArch64/gep-nullptr.ll | ||
---|---|---|
3 | Why is an assert build required? |
I believe you still need to add the nullptr checks for FirstGEP and SecondGEP.