File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
llvm/lib/Target/DirectX/DXILWriter Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -81,21 +81,24 @@ static void legalizeLifetimeIntrinsics(Module &M) {
81
81
}
82
82
83
83
static void removeLifetimeIntrinsics (Module &M) {
84
- for (Function &F : make_early_inc_range (M))
84
+ for (Function &F : make_early_inc_range (M)) {
85
+
85
86
if (Intrinsic::ID IID = F.getIntrinsicID ();
86
- IID == Intrinsic::lifetime_start || IID == Intrinsic::lifetime_end) {
87
- for (User *U : make_early_inc_range (F. users ())) {
88
- LifetimeIntrinsic *LI = dyn_cast<LifetimeIntrinsic>(U);
89
- assert (LI && " Expected user of lifetime intrinsic function to be "
90
- " a LifetimeIntrinsic instruction " );
91
- BitCastInst *BCI = dyn_cast<BitCastInst>(LI-> getArgOperand ( 1 ));
92
- assert (BCI && " Expected pointer operand of LifetimeIntrinsic to be a "
93
- " BitCastInst" );
94
- LI-> eraseFromParent ();
95
- BCI-> eraseFromParent ( );
96
- }
97
- F. eraseFromParent ();
87
+ IID != Intrinsic::lifetime_start && IID != Intrinsic::lifetime_end)
88
+ continue ;
89
+
90
+ for (User *U : make_early_inc_range (F. users ())) {
91
+ LifetimeIntrinsic *LI = dyn_cast< LifetimeIntrinsic>(U );
92
+ assert (LI && " Expected user of lifetime intrinsic function to be "
93
+ " a LifetimeIntrinsic instruction " );
94
+ BitCastInst *BCI = dyn_cast< BitCastInst>(LI-> getArgOperand ( 1 ) );
95
+ assert (BCI && " Expected pointer operand of LifetimeIntrinsic to be a "
96
+ " BitCastInst " );
97
+ LI-> eraseFromParent ();
98
+ BCI-> eraseFromParent ();
98
99
}
100
+ F.eraseFromParent ();
101
+ }
99
102
}
100
103
101
104
class EmbedDXILPass : public llvm ::ModulePass {
You can’t perform that action at this time.
0 commit comments