[llvm] [AMDGPU] Create local KnownBits in case DenseMap gets invalidated (PR #111568)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 07:59:17 PDT 2024
================
@@ -1,120 +1,144 @@
-; REQUIRES: asserts
-; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -o - %s 2>&1 | FileCheck %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 < %s | FileCheck %s
-; CHECK-NOT: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be same for comparison"' failed
+; Previously, this would hit an assertion on incompatible comparison between
+; APInts due to BitWidth differences. This was due to assignment of DenseMap
+; value using another value within that same DenseMap which results in a
+; use-after-free if the assignment operator invokes a DenseMap growth.
-define void @RunTic() {
- %call5.i1 = call i32 @G_CheckDemoStatus()
- tail call void @D_AdvanceDemo()
- call void @G_Ticker()
+; CHECK-LABEL: I_Quit:
+define void @I_Quit() {
+ %fptr = load ptr, ptr null, align 8
+ tail call void %fptr()
ret void
}
-define void @G_Ticker() {
- call void @G_DoReborn()
- tail call void @F_Ticker()
- tail call void @AM_Stop()
- tail call void @F_StartFinale()
- tail call void @D_AdvanceDemo()
- %call.i.i449 = call i32 @R_FlatNumForName()
- %call9.i.i = call i32 @R_TextureNumForName()
- %call.i306 = tail call ptr @P_TempSaveGameFile()
- %call1.i307 = call ptr @P_SaveGameFile()
- call void (...) @I_Error()
+; CHECK-LABEL: P_RemoveMobj:
+define void @P_RemoveMobj() {
ret void
}
-define void @G_DoReborn() {
- call void @P_RemoveMobj()
- call void @P_SpawnMobj()
- call void @P_SpawnPlayer()
- call void (...) @I_Error()
+; CHECK-LABEL: P_SpawnMobj:
----------------
arsenm wrote:
Just checking all the labels isn't really useful
https://github.com/llvm/llvm-project/pull/111568
More information about the llvm-commits
mailing list