[llvm] [DirectX backend] avoid generate redundant bitcast in DXILPrepareModule (PR #65163)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 13:06:59 PDT 2023


================
@@ -2,9 +2,16 @@
 target triple = "dxil-unknown-unknown"
 
 ; Make sure not crash when has typed ptr.
-; CHECK:@test
+; CHECK:define i64 @test(ptr %p)
+; Make sure no bitcast generated.
+; CHECK-NOT:bitcast
----------------
bogner wrote:

It'd be better to add a second test in this file (`define void @test_gep()` or so) that just does the geps and the store, rather than mixing the two, to make it clearer what the two things being tested here are.

Also, I'd probably just use update_test_checks for these rather than ad-hoc CHECK-NOTs, it's a lot clearer to see what's happening that way.

https://github.com/llvm/llvm-project/pull/65163


More information about the llvm-commits mailing list